summaryrefslogtreecommitdiff
path: root/runtime/macros
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-05-05 18:24:42 +0000
committerBram Moolenaar <Bram@vim.org>2007-05-05 18:24:42 +0000
commitc81e5e79a0f2f5c2ac1896fa51cbe47e2e2a8d97 (patch)
tree5211ea86daed8e43c3dd25458e808c3d32100097 /runtime/macros
parent9aae141a6bcfc26bcce352deb8bf34566a3e1be2 (diff)
downloadvim-git-c81e5e79a0f2f5c2ac1896fa51cbe47e2e2a8d97.tar.gz
updated for version 7.1a
Diffstat (limited to 'runtime/macros')
-rw-r--r--runtime/macros/less.vim6
-rw-r--r--runtime/macros/matchit.vim26
2 files changed, 17 insertions, 15 deletions
diff --git a/runtime/macros/less.vim b/runtime/macros/less.vim
index bbd74fbf4..959a5d735 100644
--- a/runtime/macros/less.vim
+++ b/runtime/macros/less.vim
@@ -1,6 +1,6 @@
" Vim script to work like "less"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2006 May 07
+" Last Change: 2006 Dec 05
" Avoid loading this file twice, allow the user to define his own script.
if exists("loaded_less")
@@ -168,7 +168,7 @@ fun! s:Forward()
else
noremap <script> N Hg0Nzt<SID>L
endif
- cnoremap <script> <CR> <CR>:cunmap <lt>CR><CR>zt<SID>L
+ cnoremap <silent> <script> <CR> <CR>:cunmap <lt>CR><CR>zt<SID>L
endfun
fun! s:Backward()
@@ -179,7 +179,7 @@ fun! s:Backward()
noremap <script> n Hg0nzt<SID>L
endif
noremap <script> N H$Nzt<SID>L
- cnoremap <script> <CR> <CR>:cunmap <lt>CR><CR>zt<SID>L
+ cnoremap <silent> <script> <CR> <CR>:cunmap <lt>CR><CR>zt<SID>L
endfun
call s:Forward()
diff --git a/runtime/macros/matchit.vim b/runtime/macros/matchit.vim
index a2f205076..7fcc53e80 100644
--- a/runtime/macros/matchit.vim
+++ b/runtime/macros/matchit.vim
@@ -1,7 +1,7 @@
" matchit.vim: (global plugin) Extended "%" matching
-" Last Change: Sun Feb 26 10:00 AM 2006 EST
+" Last Change: Mon May 15 10:00 PM 2006 EDT
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
-" Version: 1.10, for Vim 6.3
+" Version: 1.11, for Vim 6.3+
" URL: http://www.vim.org/script.php?script_id=39
" Documentation:
@@ -15,7 +15,7 @@
" Support for many languages by Johannes Zellner
" Suggestions for improvement, bug reports, and support for additional
" languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark
-" Collett, Stephen Wall, Dany St-Amant, and Johannes Zellner.
+" Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner.
" Debugging:
" If you'd like to try the built-in debugging commands...
@@ -172,9 +172,10 @@ function! s:Match_wrapper(word, forward, mode) range
else " Find the match that ends on or after the cursor and set curcol.
let regexp = s:Wholematch(matchline, s:all, startcol-1)
let curcol = match(matchline, regexp)
- let suf = strlen(matchline) - matchend(matchline, regexp)
- let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(')
- let suffix = (suf ? '\).\{' . suf . '}$' : '\)$')
+ let endcol = matchend(matchline, regexp)
+ let suf = strlen(matchline) - endcol
+ let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(')
+ let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$')
" If the match comes from the defaults, bail out.
if matchline !~ prefix .
\ substitute(s:pat, s:notslash.'\zs[,:]\+', '\\|', 'g') . suffix
@@ -262,10 +263,11 @@ function! s:Match_wrapper(word, forward, mode) range
normal! H
let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
execute restore_cursor
- normal! 0
- if curcol
- execute "normal!" . curcol . "l"
- endif
+ call cursor(0, curcol + 1)
+ " normal! 0
+ " if curcol
+ " execute "normal!" . curcol . "l"
+ " endif
if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
let skip = "0"
else
@@ -415,9 +417,9 @@ endfun
" let match = matchstr(getline("."), regexp)
fun! s:Wholematch(string, pat, start)
let group = '\%(' . a:pat . '\)'
- let prefix = (a:start ? '\(^.\{,' . a:start . '}\)\zs' : '^')
+ let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^')
let len = strlen(a:string)
- let suffix = (a:start+1 < len ? '\(.\{,'.(len-a:start-1).'}$\)\@=' : '$')
+ let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$')
if a:string !~ prefix . group . suffix
let prefix = ''
endif