aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-06 20:39:39 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-06 20:39:39 +1300
commit280a3be87f49193cbb1293616bd5b82d924c5bfa (patch)
tree7e4eac7107773fe523e4c909b73a3f22acf1e772
parentUse v:count1 directly in function (diff)
downloadvim-nextag-280a3be87f49193cbb1293616bd5b82d924c5bfa.tar.gz
vim-nextag-280a3be87f49193cbb1293616bd5b82d924c5bfa.zip
Move tag pattern into variable
-rw-r--r--plugin/nextag.vim4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugin/nextag.vim b/plugin/nextag.vim
index 97f220f..04c2160 100644
--- a/plugin/nextag.vim
+++ b/plugin/nextag.vim
@@ -17,6 +17,8 @@ if exists('g:loaded_nextag') || &compatible || v:version < 700
endif
let g:loaded_nextag = 1
+let s:tag = '\m<\/\?\w\+[^>]*>'
+
"
" Search for a SGML tag with the specified flag.
"
@@ -26,7 +28,7 @@ function! s:MoveToSGMLTag(direction, mode)
endif
let l:visualfix = a:mode ==# 'v' && a:direction ==# 'next' && &selection !=# 'exclusive' ? 1 : 0
for l:iteration in range(1, v:count1)
- call search('\m<\/\?\w\+[^>]*>', a:direction ==# 'next' ? 'W' : 'Wb')
+ call search(s:tag, a:direction ==# 'next' ? 'W' : 'Wb')
if l:visualfix
normal! l
endif