aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2012-02-11 04:41:08 +1300
committerTom Ryder <tom@sanctum.geek.nz>2012-02-11 04:41:08 +1300
commitaad8108e25c17f3a0e3bbc68d350091b1e0ccdc8 (patch)
tree292b25e35ef46084ee77d0c96e0275abe4bf7208
parentMore explanatory comment. (diff)
downloadvim-nextag-aad8108e25c17f3a0e3bbc68d350091b1e0ccdc8.tar.gz
vim-nextag-aad8108e25c17f3a0e3bbc68d350091b1e0ccdc8.zip
Nicer structure for function.
-rw-r--r--plugin/nextag.vim16
1 files changed, 6 insertions, 10 deletions
diff --git a/plugin/nextag.vim b/plugin/nextag.vim
index bc8e8eb..13ee404 100644
--- a/plugin/nextag.vim
+++ b/plugin/nextag.vim
@@ -23,19 +23,15 @@ function! s:MoveToSGMLTag(direction, mode, count)
if a:mode == 'v'
normal! gv
endif
- let l:flags = (a:direction == "next") ? "W" : "Wb"
+ let l:visualfix = a:mode == 'v' && a:direction == 'next' && &selection != 'exclusive' ? 1 : 0
for l:iteration in range(1, a:count)
- call search("<\S*[^>]*>", l:flags)
- if a:mode == 'v'
- if a:direction == 'next' && &selection != 'exclusive'
- normal! l
- endif
+ call search("<\S*[^>]*>", a:direction == "next" ? "W" : "Wb")
+ if l:visualfix
+ normal! l
endif
endfor
- if a:mode == 'v'
- if a:direction == 'next' && &selection != 'exclusive'
- normal! h
- endif
+ if l:visualfix
+ normal! h
endif
endfunction