diff options
Diffstat (limited to 'plugin/nextag.vim')
-rw-r--r-- | plugin/nextag.vim | 16 |
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 |