mirror of
https://github.com/preservim/vim-indent-guides.git
synced 2025-11-16 21:53:39 -05:00
Compare commits
11 Commits
developmen
...
1.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf6f4d4661 | ||
|
|
2cbe919452 | ||
|
|
e8f50f3c8b | ||
|
|
f1c115ce5d | ||
|
|
287132df04 | ||
|
|
bdf4ec3ff8 | ||
|
|
57b6da6d12 | ||
|
|
6854275667 | ||
|
|
eb5644430a | ||
|
|
951619130f | ||
|
|
9d189306aa |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
doc/tags
|
||||
@@ -46,7 +46,9 @@ function! indent_guides#enable()
|
||||
let l:hard_pattern = indent_guides#indent_highlight_pattern('\t', l:column_start, s:indent_size)
|
||||
|
||||
" define the higlight patterns and add to matches list
|
||||
call add(w:indent_guides_matches, matchadd(l:group, l:soft_pattern))
|
||||
if g:indent_guides_space_guides
|
||||
call add(w:indent_guides_matches, matchadd(l:group, l:soft_pattern))
|
||||
end
|
||||
call add(w:indent_guides_matches, matchadd(l:group, l:hard_pattern))
|
||||
endfor
|
||||
endfunction
|
||||
@@ -68,7 +70,11 @@ function! indent_guides#clear_matches()
|
||||
if !empty(w:indent_guides_matches)
|
||||
let l:index = 0
|
||||
for l:match_id in w:indent_guides_matches
|
||||
call matchdelete(l:match_id)
|
||||
try
|
||||
call matchdelete(l:match_id)
|
||||
catch /E803:/
|
||||
" Do nothing
|
||||
endtry
|
||||
call remove(w:indent_guides_matches, l:index)
|
||||
let l:index += l:index
|
||||
endfor
|
||||
@@ -180,12 +186,18 @@ function! indent_guides#init_script_vars()
|
||||
let s:debug = g:indent_guides_debug
|
||||
let s:indent_levels = g:indent_guides_indent_levels
|
||||
let s:auto_colors = g:indent_guides_auto_colors
|
||||
let s:change_percent = g:indent_guides_color_change_percent / str2float("100.0")
|
||||
let s:color_hex_pat = g:indent_guides_color_hex_pattern
|
||||
let s:color_hex_bg_pat = g:indent_guides_color_hex_guibg_pattern
|
||||
let s:color_name_bg_pat = g:indent_guides_color_name_guibg_pattern
|
||||
let s:start_level = g:indent_guides_start_level
|
||||
|
||||
" str2float not available in vim versions <= 7.1
|
||||
if has('float')
|
||||
let s:change_percent = g:indent_guides_color_change_percent / str2float('100.0')
|
||||
else
|
||||
let s:change_percent = g:indent_guides_color_change_percent / 100.0
|
||||
endif
|
||||
|
||||
if s:debug
|
||||
echo 's:indent_size = ' . s:indent_size
|
||||
echo 's:guide_size = ' . s:guide_size
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
|
||||
Author: Nate Kane <nathanaelkane AT gmail DOT com>
|
||||
Version: 1.5
|
||||
Last Change: 13 Mar 2011
|
||||
Version: 1.6
|
||||
Last Change: 01 Jan 2012
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *indent-guides-contents*
|
||||
@@ -133,6 +133,14 @@ Default: 1. Values: between 1 and g:|indent_guides_indent_levels|.
|
||||
let g:indent_guides_start_level = 2
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'indent_guides_space_guides'*
|
||||
Use this option to control whether the plugin considers spaces as indention.
|
||||
|
||||
Default: 1. Values: 0 or 1.
|
||||
>
|
||||
let g:indent_guides_space_guides = 0
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
*'indent_guides_enable_on_vim_startup'*
|
||||
Use this option to control whether the plugin is enabled on Vim startup.
|
||||
@@ -212,13 +220,19 @@ Credits:~
|
||||
Contact:~
|
||||
* Twitter: @nathanaelkane
|
||||
* Email: <nathanaelkane AT gmail DOT com>
|
||||
* IRC: nate- on Freenode (I usually idle in the #vim channel)
|
||||
|
||||
Bug reports, feedback, suggestions etc are welcomed.
|
||||
|
||||
==============================================================================
|
||||
7. CHANGELOG *indent-guides-changelog*
|
||||
|
||||
1.6~
|
||||
* Added option g:|indent_guides_space_guides| to control whether spaces are
|
||||
considered as indention (thanks scoz).
|
||||
* Added 'doc/tags' to gitignore (thanks lenniboy).
|
||||
* Fixed E803 ID not found spam (thanks mutewinter).
|
||||
* Fixed str2float issue with Vim 7.1 (thanks acx0).
|
||||
|
||||
1.5~
|
||||
* Added highlight support for files with a mixture of tab and space indent
|
||||
styles (thanks graywh).
|
||||
@@ -258,7 +272,7 @@ Bug reports, feedback, suggestions etc are welcomed.
|
||||
The MIT Licence
|
||||
http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
Copyright (c) 2010-2011 Nate Kane
|
||||
Copyright (c) 2010-2012 Nate Kane
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -52,6 +52,7 @@ call s:InitVariable('g:indent_guides_guide_size', 0 )
|
||||
call s:InitVariable('g:indent_guides_start_level', 1 )
|
||||
call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0 )
|
||||
call s:InitVariable('g:indent_guides_debug', 0 )
|
||||
call s:InitVariable('g:indent_guides_space_guides', 1 )
|
||||
|
||||
" Default mapping
|
||||
nmap <Leader>ig :IndentGuidesToggle<CR>
|
||||
|
||||
Reference in New Issue
Block a user