Change indent comparison to !~ with explanation
Truth table: x x != 0 x !~ 0 0 0 0 1 1 1 '==' 0 1
This commit is contained in:
parent
93ef4c9e42
commit
a1e28c4411
@ -8,7 +8,8 @@ function! s:exchange(x, y, reverse, expand)
|
||||
let selection = &selection
|
||||
set selection=inclusive
|
||||
|
||||
let indent = s:get_setting('exchange_indent', 1) != 0 && a:x.type ==# 'V' && a:y.type ==# 'V'
|
||||
" Compare using =~ because "'==' != 0" returns 0
|
||||
let indent = s:get_setting('exchange_indent', 1) !~ 0 && a:x.type ==# 'V' && a:y.type ==# 'V'
|
||||
|
||||
if indent
|
||||
let xindent = matchstr(getline(nextnonblank(a:y.start.line)), '^\s*')
|
||||
|
Loading…
Reference in New Issue
Block a user