0
0
mirror of https://github.com/vim/vim.git synced 2025-07-25 10:54:51 -04:00

updated for version 7.0065

This commit is contained in:
Bram Moolenaar 2005-03-28 20:58:01 +00:00
parent 8b879e7fe8
commit 582fd85b02
25 changed files with 278 additions and 197 deletions

View File

@ -1,6 +1,6 @@
" Vim color file " Vim color file
" Maintainer: Bohdan Vlasyuk <bohdan@vstu.edu.ua> " Maintainer: Bohdan Vlasyuk <bohdan@vstu.edu.ua>
" Last Change: 2002 Mar 09 " Last Change: 2005 Mar 28
" darkblue -- for those who prefer dark background " darkblue -- for those who prefer dark background
" [note: looks bit uglier with come terminal palettes, " [note: looks bit uglier with come terminal palettes,
@ -45,8 +45,8 @@ hi DiffChange guibg=darkmagenta ctermbg=magenta cterm=none
hi DiffDelete ctermfg=blue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan hi DiffDelete ctermfg=blue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan
hi DiffText cterm=bold ctermbg=red gui=bold guibg=Red hi DiffText cterm=bold ctermbg=red gui=bold guibg=Red
hi Cursor guifg=#000020 guibg=#ffaf38 ctermfg=bg ctermbg=brown hi Cursor guifg=black guibg=yellow ctermfg=black ctermbg=yellow
hi lCursor guifg=#ffffff guibg=#000000 ctermfg=bg ctermbg=darkgreen hi lCursor guifg=black guibg=white ctermfg=black ctermbg=white
hi Comment guifg=#80a0ff ctermfg=darkred hi Comment guifg=#80a0ff ctermfg=darkred

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0aa. Last change: 2005 Mar 25 *eval.txt* For Vim version 7.0aa. Last change: 2005 Mar 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -2534,8 +2534,8 @@ getqflist() *getqflist()*
bufname() to get the name bufname() to get the name
lnum line number in the buffer (first line is 1) lnum line number in the buffer (first line is 1)
col column number (first column is 1) col column number (first column is 1)
vcol non-zero: column number is visual column vcol non-zero: "col" is visual column
zero: column number is byte index zero: "col" is byte index
nr error number nr error number
text description of the error text description of the error
type type of the error, 'E', '1', etc. type type of the error, 'E', '1', etc.
@ -3290,7 +3290,9 @@ readfile({fname} [, {binary} [, {max}]])
:for line in readfile(fname, '', 10) :for line in readfile(fname, '', 10)
: if line =~ 'Date' | echo line | endif : if line =~ 'Date' | echo line | endif
:endfor :endfor
< When {max} is zero or negative the result is an empty list. < When {max} is negative -{max} lines from the end of the file
are returned, or as many as there are.
When {max} is zero the result is an empty list.
Note that without {max} the whole file is read into memory. Note that without {max} the whole file is read into memory.
Also note that there is no recognition of encoding. Read a Also note that there is no recognition of encoding. Read a
file into a buffer if you need to. file into a buffer if you need to.
@ -3600,12 +3602,17 @@ setqflist({list}) *setqflist()*
filename name of a file filename name of a file
lnum line number in the file lnum line number in the file
col column number
pattern search pattern used to locate the error pattern search pattern used to locate the error
col column number
vcol when non-zero: "col" is visual column
when zero: "col" is byte index
nr error number
text description of the error text description of the error
type single-character error type, 'E', 'W', etc.
The "col" and "text" entries are optional. Either "lnum" or The "col", "vcol", "nr", "type" and "text" entries are
"pattern" entry can be used to locate a matching error line. optional. Either "lnum" or "pattern" entry can be used to
locate a matching error line.
If the "filename" entry is not present or neither the "lnum" If the "filename" entry is not present or neither the "lnum"
or "pattern" entries are present, then the item will not be or "pattern" entries are present, then the item will not be
handled as an error line. handled as an error line.

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0aa. Last change: 2005 Mar 21 *options.txt* For Vim version 7.0aa. Last change: 2005 Mar 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1570,8 +1570,8 @@ A jump table for the options with a short description can be found at |Q_op|.
6. included files 6. included files
As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'- As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'-
based expansion (eg dictionary |i_CTRL-X_CTRL-K|, included patterns based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns
|i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions) |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions).
*'completefunc'* *'cfu'* *'completefunc'* *'cfu'*
'completefunc' 'cfu' string (default: empty) 'completefunc' 'cfu' string (default: empty)
@ -3064,7 +3064,7 @@ A jump table for the options with a short description can be found at |Q_op|.
i - italic i - italic
u - underline u - underline
s - strikeout s - strikeout
cXX - character set XX. valid charsets are: ANSI, ARABIC, cXX - character set XX. Valid charsets are: ANSI, ARABIC,
BALTIC, CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK, BALTIC, CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK,
HANGEUL, HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS, HANGEUL, HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS,
SYMBOL, THAI, TURKISH, VIETNAMESE ANSI and BALTIC. SYMBOL, THAI, TURKISH, VIETNAMESE ANSI and BALTIC.
@ -3146,7 +3146,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'guioptions'* *'go'* *'guioptions'* *'go'*
'guioptions' 'go' string (default "gmrLtT" (MS-Windows), 'guioptions' 'go' string (default "gmrLtT" (MS-Windows),
"agimrLtT" (GTK, Motif and Athena) "agimrLtT" (GTK, Motif and Athena))
global global
{not in Vi} {not in Vi}
{only available when compiled with GUI enabled} {only available when compiled with GUI enabled}
@ -3576,7 +3576,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Pattern to be used to find an include command. It is a search Pattern to be used to find an include command. It is a search
pattern, just like for the "/" command (See |pattern|). The default pattern, just like for the "/" command (See |pattern|). The default
value is for C programs. This option is used for the commands "[i", value is for C programs. This option is used for the commands "[i",
"]I", "[d", etc.. The 'isfname' option is used to recognize the file "]I", "[d", etc. The 'isfname' option is used to recognize the file
name that comes after the matched pattern. See |option-backslash| name that comes after the matched pattern. See |option-backslash|
about including spaces and backslashes. about including spaces and backslashes.
@ -4336,12 +4336,12 @@ A jump table for the options with a short description can be found at |Q_op|.
like in an xterm. like in an xterm.
popup Right mouse button pops up a menu. The shifted left popup Right mouse button pops up a menu. The shifted left
mouse button extends a selection. This works like mouse button extends a selection. This works like
with Microsoft Windows with Microsoft Windows.
popup_setpos Like "popup", but the cursor will be moved to the popup_setpos Like "popup", but the cursor will be moved to the
position where the mouse was clicked, and thus the position where the mouse was clicked, and thus the
selected operation will act upon the clicked object. selected operation will act upon the clicked object.
If clicking inside a selection, that selection will If clicking inside a selection, that selection will
be acted upon, ie. no cursor move. This implies of be acted upon, i.e. no cursor move. This implies of
course, that right clicking outside a selection will course, that right clicking outside a selection will
end Visual mode. end Visual mode.
Overview of what button does what for each model: Overview of what button does what for each model:
@ -4364,7 +4364,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'mouseshape'* *'mouses'* *E547* *'mouseshape'* *'mouses'* *E547*
'mouseshape' 'mouses' string (default "i:beam,r:beam,s:updown,sd:cross, 'mouseshape' 'mouses' string (default "i:beam,r:beam,s:updown,sd:cross,
m:no,ml:up-arrow,v:rightup-arrow" m:no,ml:up-arrow,v:rightup-arrow")
global global
{not in Vi} {not in Vi}
{only available when compiled with the |+mouseshape| {only available when compiled with the |+mouseshape|
@ -4896,7 +4896,7 @@ A jump table for the options with a short description can be found at |Q_op|.
If 'rulerformat' is set, it will determine the contents of the ruler. If 'rulerformat' is set, it will determine the contents of the ruler.
Each window has its own ruler. If a window has a status line, the Each window has its own ruler. If a window has a status line, the
ruler is shown there. Otherwise it is shown in the last line of the ruler is shown there. Otherwise it is shown in the last line of the
screen. If the statusline is given by 'statusline' (ie. not empty), screen. If the statusline is given by 'statusline' (i.e. not empty),
this option takes precedence over 'ruler' and 'rulerformat' this option takes precedence over 'ruler' and 'rulerformat'
If the number of characters displayed is different from the number of If the number of characters displayed is different from the number of
bytes in the text (e.g., for a TAB or a multi-byte character), both bytes in the text (e.g., for a TAB or a multi-byte character), both
@ -4950,7 +4950,7 @@ A jump table for the options with a short description can be found at |Q_op|.
$VIM/vimfiles, $VIM/vimfiles,
$VIMRUNTIME, $VIMRUNTIME,
$VIM/vimfiles/after, $VIM/vimfiles/after,
sys$login:vimfiles/after" sys$login:vimfiles/after")
global global
{not in Vi} {not in Vi}
This is a list of directories which will be searched for runtime This is a list of directories which will be searched for runtime
@ -5763,7 +5763,7 @@ A jump table for the options with a short description can be found at |Q_op|.
= - Separation point between left and right aligned items. = - Separation point between left and right aligned items.
No width fields allowed. No width fields allowed.
* - Set highlight group to User{N}, where {N} is taken from the * - Set highlight group to User{N}, where {N} is taken from the
minwid field. eg. %1*. Restore normal highlight with %* or %0*. minwid field, e.g. %1*. Restore normal highlight with %* or %0*.
The difference between User{N} and StatusLine will be applied The difference between User{N} and StatusLine will be applied
to StatusLineNC for the statusline of non-current windows. to StatusLineNC for the statusline of non-current windows.
The number N must be between 1 and 9. See |hl-User1..9| The number N must be between 1 and 9. See |hl-User1..9|
@ -5777,7 +5777,7 @@ A jump table for the options with a short description can be found at |Q_op|.
if the preceding character stems from another active flag. This will if the preceding character stems from another active flag. This will
make a nice display when flags are used like in the examples below. make a nice display when flags are used like in the examples below.
When all items in a group becomes an empty string (ie. flags that are When all items in a group becomes an empty string (i.e. flags that are
not set) and a minwid is not set for the group, the whole group will not set) and a minwid is not set for the group, the whole group will
become empty. This will make a group like the following disappear become empty. This will make a group like the following disappear
completely from the statusline when none of the flags are set. > completely from the statusline when none of the flags are set. >

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Sep 01 " Last Change: 2005 Mar 27
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@ -11,12 +11,10 @@ endif
" Don't load another plugin for this buffer " Don't load another plugin for this buffer
let b:did_ftplugin = 1 let b:did_ftplugin = 1
" Using line continuation here.
set cpo-=C set cpo-=C
let b:undo_ftplugin = "setl cin< fo< com<" let b:undo_ftplugin = "setl fo< com< | if has('vms') | setl isk< | endif"
\ . "| if has('vms') | setl isk< | endif"
setlocal cindent
" Set 'formatoptions' to break comment lines but not other lines, " Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o". " and insert the comment leader when hitting <CR> or using "o".

View File

@ -216,7 +216,7 @@ if &filetype == "changelog"
command! -nargs=0 NewChangelogEntry call s:new_changelog_entry() command! -nargs=0 NewChangelogEntry call s:new_changelog_entry()
endif endif
let b:undo_ftplugin = "setl com< tw< fo< et< ai<" let b:undo_ftplugin = "setl com< tw< fo< et<"
if &textwidth == 0 if &textwidth == 0
setlocal textwidth=78 setlocal textwidth=78
@ -224,7 +224,7 @@ if &filetype == "changelog"
setlocal comments= setlocal comments=
setlocal formatoptions+=t setlocal formatoptions+=t
setlocal noexpandtab setlocal noexpandtab
setlocal autoindent " setlocal autoindent now in indent file
let &cpo = cpo_save let &cpo = cpo_save
else else

View File

@ -11,8 +11,6 @@ endif
" Don't load another plugin for this buffer " Don't load another plugin for this buffer
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setlocal cindent
" Set 'formatoptions' to break comment lines but not other lines, " Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o". " and insert the comment leader when hitting <CR> or using "o".
setlocal fo-=t fo+=croql setlocal fo-=t fo+=croql

View File

@ -6,8 +6,6 @@
if exists("b:did_ftplugin") | finish | endif if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setlocal nocindent
setlocal autoindent
setlocal foldmethod=syntax setlocal foldmethod=syntax
set cpo-=C set cpo-=C

View File

@ -14,7 +14,6 @@ endif
" Don't load another plugin for this buffer " Don't load another plugin for this buffer
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setl autoindent
setl comments=:; setl comments=:;
setl define=^\\s*(def\\k* setl define=^\\s*(def\\k*
setl formatoptions-=t setl formatoptions-=t
@ -25,6 +24,3 @@ setl lisp
" e.g. insertion of ;;; and ;; on normal "O" or "o" when staying in comment " e.g. insertion of ;;; and ;; on normal "O" or "o" when staying in comment
setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|# setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|#
setl formatoptions+=croql setl formatoptions+=croql
" with smartindent # cause left alignment
setl nosmartindent

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: RPL/2 " Language: RPL/2
" Maintainer: Joël BERTRAND <rpl2@free.fr> " Maintainer: Joël BERTRAND <rpl2@free.fr>
" Last Change: 2002 Feb 07 " Last Change: 2005 Mar 28
" Version: 0.1 " Version: 0.1
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
@ -12,8 +12,6 @@ endif
" Don't load another plugin for this buffer " Don't load another plugin for this buffer
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setlocal autoindent
" Set 'formatoptions' to break comment lines but not other lines, " Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o". " and insert the comment leader when hitting <CR> or using "o".
setlocal fo-=t fo+=croql setlocal fo-=t fo+=croql

View File

@ -6,8 +6,6 @@
if exists("b:did_ftplugin") | finish | endif if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setlocal nocindent
setlocal autoindent
setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:' setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:'
" we need this wrapper, as call doesn't allow a count " we need this wrapper, as call doesn't allow a count

View File

@ -1,7 +1,7 @@
" Vim support file to switch on loading indent files for file types " Vim support file to switch on loading indent files for file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2001 Sep 12 " Last Change: 2005 Mar 28
if exists("did_indent_on") if exists("did_indent_on")
finish finish
@ -9,5 +9,17 @@ endif
let did_indent_on = 1 let did_indent_on = 1
augroup filetypeindent augroup filetypeindent
au FileType * if expand("<amatch>") != "" | if exists("b:did_indent") | unlet b:did_indent | endif | runtime! indent/<amatch>.vim | endif au FileType * call s:LoadIndent()
func! s:LoadIndent()
if exists("b:undo_indent")
exe b:undo_indent
unlet! b:undo_indent b:did_indent
endif
if expand("<amatch>") != ""
if exists("b:did_indent")
unlet b:did_indent
endif
runtime! indent/<amatch>.vim
endif
endfunc
augroup END augroup END

15
runtime/indent/bib.vim Normal file
View File

@ -0,0 +1,15 @@
" Vim indent file
" Language: BibTeX
" Maintainer: Dorai Sitaram <ds26@gte.com>
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
" Last Change: 2005 Mar 28
" Only do this when not done yet for this buffer
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal cindent
let b:undo_indent = "setl cin<"

View File

@ -1,7 +1,7 @@
" Vim indent file " Vim indent file
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2001 Jun 12 " Last Change: 2005 Mar 27
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")
@ -11,3 +11,5 @@ let b:did_indent = 1
" C indenting is built-in, thus this is very simple " C indenting is built-in, thus this is very simple
setlocal cindent setlocal cindent
let b:undo_indent = "setl cin<"

View File

@ -11,3 +11,5 @@ let b:did_indent = 1
" C# is like indenting C " C# is like indenting C
setlocal cindent setlocal cindent
let b:undo_indent = "setl cin<"

15
runtime/indent/lisp.vim Normal file
View File

@ -0,0 +1,15 @@
" Vim indent file
" Language: Lisp
" Maintainer: noone
" Last Change: 2005 Mar 28
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
" Autoindent is the best we can do.
setlocal ai
let b:undo_indent = "setl ai<"

View File

@ -1,7 +1,7 @@
" Vim indent file " Vim indent file
" Language: RPL/2 " Language: RPL/2
" Version: 0.2 " Version: 0.2
" Last Change: 2002 August 16 " Last Change: 2005 Mar 28
" Maintainer: BERTRAND Joël <rpl2@free.fr> " Maintainer: BERTRAND Joël <rpl2@free.fr>
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@ -10,6 +10,7 @@ if exists("b:did_indent")
endif endif
let b:did_indent = 1 let b:did_indent = 1
setlocal autoindent
setlocal indentkeys+==~end,=~case,=~if,=~then,=~else,=~do,=~until,=~while,=~repeat,=~select,=~default,=~for,=~start,=~next,=~step,<<>,<>> setlocal indentkeys+==~end,=~case,=~if,=~then,=~else,=~do,=~until,=~while,=~repeat,=~select,=~default,=~for,=~start,=~next,=~step,<<>,<>>
" Define the appropriate indent function but only once " Define the appropriate indent function but only once
@ -18,6 +19,8 @@ if exists("*RplGetFreeIndent")
finish finish
endif endif
let b:undo_indent = "set ai< indentkeys< indentexpr<"
function RplGetIndent(lnum) function RplGetIndent(lnum)
let ind = indent(a:lnum) let ind = indent(a:lnum)
let prevline=getline(a:lnum) let prevline=getline(a:lnum)

View File

@ -8,10 +8,13 @@ if exists("b:did_indent")
endif endif
let b:did_indent = 1 let b:did_indent = 1
setlocal autoindent
setlocal indentexpr=VbGetIndent(v:lnum) setlocal indentexpr=VbGetIndent(v:lnum)
setlocal indentkeys& setlocal indentkeys&
setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,=~loop,<:> setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,=~loop,<:>
let b:undo_indent = "set ai< indentexpr< indentkeys<"
" Only define the function once. " Only define the function once.
if exists("*VbGetIndent") if exists("*VbGetIndent")
finish finish

View File

@ -1787,7 +1787,7 @@ installruntime: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \
cd $(COMPSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_COMP) cd $(COMPSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_COMP)
cd $(DEST_COMP); chmod $(HELPMOD) *.vim README.txt cd $(DEST_COMP); chmod $(HELPMOD) *.vim README.txt
installmacros: $(MACROSOURCE) $(DEST_VIM) $(DEST_RT) $(DEST_MACRO) installmacros: $(DEST_VIM) $(DEST_RT) $(DEST_MACRO)
$(INSTALL_DATA_R) $(MACROSOURCE)/* $(DEST_MACRO) $(INSTALL_DATA_R) $(MACROSOURCE)/* $(DEST_MACRO)
chmod $(DIRMOD) `find $(DEST_MACRO) -type d -print` chmod $(DIRMOD) `find $(DEST_MACRO) -type d -print`
chmod $(FILEMOD) `find $(DEST_MACRO) -type f -print` chmod $(FILEMOD) `find $(DEST_MACRO) -type f -print`
@ -1799,14 +1799,14 @@ installmacros: $(MACROSOURCE) $(DEST_VIM) $(DEST_RT) $(DEST_MACRO)
fi fi
# install the tutor files # install the tutor files
installtutor: $(TUTORSOURCE) $(DEST_VIM) $(DEST_RT) $(DEST_TUTOR) installtutor: $(DEST_VIM) $(DEST_RT) $(DEST_TUTOR)
$(INSTALL_DATA) vimtutor $(DEST_BIN)/$(VIMNAME)tutor $(INSTALL_DATA) vimtutor $(DEST_BIN)/$(VIMNAME)tutor
chmod $(SCRIPTMOD) $(DEST_BIN)/$(VIMNAME)tutor chmod $(SCRIPTMOD) $(DEST_BIN)/$(VIMNAME)tutor
-$(INSTALL_DATA) $(TUTORSOURCE)/README* $(TUTORSOURCE)/tutor* $(DEST_TUTOR) -$(INSTALL_DATA) $(TUTORSOURCE)/README* $(TUTORSOURCE)/tutor* $(DEST_TUTOR)
chmod $(HELPMOD) $(DEST_TUTOR)/* chmod $(HELPMOD) $(DEST_TUTOR)/*
# Install the spell files, if they exist. # Install the spell files, if they exist.
installspell: $(SPELLSOURCE) $(DEST_VIM) $(DEST_RT) $(DEST_SPELL) installspell: $(DEST_VIM) $(DEST_RT) $(DEST_SPELL)
if test -f $(SPELLSOURCE)/en.spl; then \ if test -f $(SPELLSOURCE)/en.spl; then \
$(INSTALL_DATA) $(SPELLSOURCE)/*.spl $(DEST_SPELL); \ $(INSTALL_DATA) $(SPELLSOURCE)/*.spl $(DEST_SPELL); \
chmod $(HELPMOD) $(DEST_SPELL)/*.spl; \ chmod $(HELPMOD) $(DEST_SPELL)/*.spl; \

View File

@ -12,7 +12,7 @@
* (C) 2000 by Thomas Capricelli <orzel@freehackers.org> * (C) 2000 by Thomas Capricelli <orzel@freehackers.org>
* *
* Please visit http://freehackers.org/kvim for other vim- or * Please visit http://freehackers.org/kvim for other vim- or
* kde-related coding. * kde-related coding. (URL currently doesn't work...)
* *
* $Id$ * $Id$
* *

View File

@ -5163,10 +5163,19 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
STRCAT(command, pat[i]); STRCAT(command, pat[i]);
STRCAT(command, "\""); STRCAT(command, "\"");
#else #else
int intick = FALSE;
p = command + STRLEN(command); p = command + STRLEN(command);
*p++ = ' '; *p++ = ' ';
for (j = 0; pat[i][j] != NUL; ) for (j = 0; pat[i][j] != NUL; )
if (vim_strchr((char_u *)" '", pat[i][j]) != NULL) {
if (pat[i][j] == '`')
{
intick = !intick;
*p++ = pat[i][j++];
}
else if (!intick && vim_strchr((char_u *)" '",
pat[i][j]) != NULL)
{ {
*p++ = '"'; *p++ = '"';
while (pat[i][j] != NUL while (pat[i][j] != NUL
@ -5181,6 +5190,7 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
if ((*p++ = pat[i][j++]) == '\\' && pat[i][j] != NUL) if ((*p++ = pat[i][j++]) == '\\' && pat[i][j] != NUL)
*p++ = pat[i][j++]; *p++ = pat[i][j++];
} }
}
*p = NUL; *p = NUL;
#endif #endif
} }

View File

@ -100,7 +100,7 @@
* *
* +----------------------+ * +----------------------+
* V | * V |
* <aa>\+ BRANCH <aa> --> BRANCH --> BACKP BRANCH --> NOTHING --> END * <aa>\+ BRANCH <aa> --> BRANCH --> BACK BRANCH --> NOTHING --> END
* | | ^ ^ * | | ^ ^
* | +-----------+ | * | +-----------+ |
* +--------------------------------------------------+ * +--------------------------------------------------+
@ -229,8 +229,6 @@
#define RE_COL 205 /* nr cmp Match column number */ #define RE_COL 205 /* nr cmp Match column number */
#define RE_VCOL 206 /* nr cmp Match virtual column number */ #define RE_VCOL 206 /* nr cmp Match virtual column number */
#define BACKP 207 /* Like BACK but for \+ */
/* /*
* Magic characters have a special meaning, they don't match literally. * Magic characters have a special meaning, they don't match literally.
* Magic characters are negative. This separates them from literal characters * Magic characters are negative. This separates them from literal characters
@ -283,8 +281,6 @@ toggle_Magic(x)
* BACK Normal "next" pointers all implicitly point forward; BACK * BACK Normal "next" pointers all implicitly point forward; BACK
* exists to make loop structures possible. * exists to make loop structures possible.
* *
* BACKP Like BACK, but used for \+. Doesn't check for an empty match.
*
* STAR,PLUS '=', and complex '*' and '+', are implemented as circular * STAR,PLUS '=', and complex '*' and '+', are implemented as circular
* BRANCH structures using BACK. Simple cases (one character * BRANCH structures using BACK. Simple cases (one character
* per match) are implemented with STAR and PLUS for speed * per match) are implemented with STAR and PLUS for speed
@ -1452,7 +1448,7 @@ regpiece(flagp)
/* Emit x+ as x(&|), where & means "self". */ /* Emit x+ as x(&|), where & means "self". */
next = regnode(BRANCH); /* Either */ next = regnode(BRANCH); /* Either */
regtail(ret, next); regtail(ret, next);
regtail(regnode(BACKP), ret); /* loop back */ regtail(regnode(BACK), ret); /* loop back */
regtail(next, regnode(BRANCH)); /* or */ regtail(next, regnode(BRANCH)); /* or */
regtail(ret, regnode(NOTHING)); /* null. */ regtail(ret, regnode(NOTHING)); /* null. */
} }
@ -2487,7 +2483,7 @@ regtail(p, val)
scan = temp; scan = temp;
} }
if (OP(scan) == BACK || OP(scan) == BACKP) if (OP(scan) == BACK)
offset = (int)(scan - val); offset = (int)(scan - val);
else else
offset = (int)(val - scan); offset = (int)(val - scan);
@ -2965,6 +2961,7 @@ static int need_clear_zsubexpr = FALSE; /* extmatch subexpressions
/* /*
* Structure used to save the current input state, when it needs to be * Structure used to save the current input state, when it needs to be
* restored after trying a match. Used by reg_save() and reg_restore(). * restored after trying a match. Used by reg_save() and reg_restore().
* Also stores the length of "backpos".
*/ */
typedef struct typedef struct
{ {
@ -2973,6 +2970,7 @@ typedef struct
char_u *ptr; /* reginput pointer, for single-line regexp */ char_u *ptr; /* reginput pointer, for single-line regexp */
lpos_T pos; /* reginput pos, for multi-line regexp */ lpos_T pos; /* reginput pos, for multi-line regexp */
} rs_u; } rs_u;
int rs_len;
} regsave_T; } regsave_T;
/* struct to save start/end pointer/position in for \(\) */ /* struct to save start/end pointer/position in for \(\) */
@ -2983,6 +2981,7 @@ typedef struct
char_u *ptr; char_u *ptr;
lpos_T pos; lpos_T pos;
} se_u; } se_u;
int se_len;
} save_se_T; } save_se_T;
static char_u *reg_getline __ARGS((linenr_T lnum)); static char_u *reg_getline __ARGS((linenr_T lnum));
@ -2993,8 +2992,8 @@ static void cleanup_subexpr __ARGS((void));
static void cleanup_zsubexpr __ARGS((void)); static void cleanup_zsubexpr __ARGS((void));
#endif #endif
static void reg_nextline __ARGS((void)); static void reg_nextline __ARGS((void));
static void reg_save __ARGS((regsave_T *save)); static void reg_save __ARGS((regsave_T *save, garray_T *gap));
static void reg_restore __ARGS((regsave_T *save)); static void reg_restore __ARGS((regsave_T *save, garray_T *gap));
static int reg_save_equal __ARGS((regsave_T *save)); static int reg_save_equal __ARGS((regsave_T *save));
static void save_se_multi __ARGS((save_se_T *savep, lpos_T *posp)); static void save_se_multi __ARGS((save_se_T *savep, lpos_T *posp));
static void save_se_one __ARGS((save_se_T *savep, char_u **pp)); static void save_se_one __ARGS((save_se_T *savep, char_u **pp));
@ -3547,7 +3546,6 @@ typedef struct regitem_S
{ {
regstate_T rs_state; /* what we are doing, one of RS_ above */ regstate_T rs_state; /* what we are doing, one of RS_ above */
char_u *rs_scan; /* current node in program */ char_u *rs_scan; /* current node in program */
long rs_startp; /* start position for BACK (offset) */
union union
{ {
save_se_T sesave; save_se_T sesave;
@ -3556,8 +3554,8 @@ typedef struct regitem_S
short rs_no; /* submatch nr */ short rs_no; /* submatch nr */
} regitem_T; } regitem_T;
static regitem_T *regstack_push __ARGS((garray_T *regstack, regstate_T state, char_u *scan, long startp)); static regitem_T *regstack_push __ARGS((garray_T *regstack, regstate_T state, char_u *scan));
static void regstack_pop __ARGS((garray_T *regstack, char_u **scan, long *startp)); static void regstack_pop __ARGS((garray_T *regstack, char_u **scan));
/* used for BEHIND and NOBEHIND matching */ /* used for BEHIND and NOBEHIND matching */
typedef struct regbehind_S typedef struct regbehind_S
@ -3576,6 +3574,14 @@ typedef struct regstar_S
long maxval; long maxval;
} regstar_T; } regstar_T;
/* used to store input position when a BACK was encountered, so that we now if
* we made any progress since the last time. */
typedef struct backpos_S
{
char_u *bp_scan; /* "scan" where BACK was encountered */
regsave_T bp_pos; /* last input position */
} backpos_T;
/* /*
* regmatch - main matching routine * regmatch - main matching routine
* *
@ -3598,7 +3604,8 @@ regmatch(scan)
char_u *next; /* Next node. */ char_u *next; /* Next node. */
int op; int op;
int c; int c;
garray_T regstack; garray_T regstack; /* stack with regitem_T items, sometimes
preceded by regstar_T or regbehind_T. */
regitem_T *rp; regitem_T *rp;
int no; int no;
int status; /* one of the RA_ values: */ int status; /* one of the RA_ values: */
@ -3607,18 +3614,17 @@ regmatch(scan)
#define RA_BREAK 3 /* break inner loop */ #define RA_BREAK 3 /* break inner loop */
#define RA_MATCH 4 /* successful match */ #define RA_MATCH 4 /* successful match */
#define RA_NOMATCH 5 /* didn't match */ #define RA_NOMATCH 5 /* didn't match */
long startp = 0; /* start position for BACK, offset to garray_T backpos; /* table with backpos_T for BACK */
regstack.ga_data */
#define STARTP2REGS(startp) (regsave_T *)(((char *)regstack.ga_data) + startp)
#define REGS2STARTP(p) (long)((char *)p - (char *)regstack.ga_data)
/* Init the regstack empty. Use an item size of 1 byte, since we push /* Init the regstack empty. Use an item size of 1 byte, since we push
* different things onto it. Use a large grow size to avoid reallocating * different things onto it. Use a large grow size to avoid reallocating
* it too often. */ * it too often. */
ga_init2(&regstack, 1, 10000); ga_init2(&regstack, 1, 10000);
ga_init2(&backpos, sizeof(backpos_T), 10);
/* /*
* Repeat until the stack is empty. * Repeat until "regstack" is empty.
*/ */
for (;;) for (;;)
{ {
@ -3635,7 +3641,7 @@ regmatch(scan)
#endif #endif
/* /*
* Repeat for items that can be matched sequential, without using the * Repeat for items that can be matched sequentially, without using the
* regstack. * regstack.
*/ */
for (;;) for (;;)
@ -4072,13 +4078,42 @@ regmatch(scan)
break; break;
case BACK: case BACK:
/* When we run into BACK without matching something non-empty, we {
* fail. */ int i;
if (startp != 0 && reg_save_equal(STARTP2REGS(startp))) backpos_T *bp;
status = RA_NOMATCH;
break;
case BACKP: /*
* When we run into BACK we need to check if we don't keep
* looping without matching any input. The second and later
* times a BACK is encountered it fails if the input is still
* at the same position as the previous time.
* The positions are stored in "backpos" and found by the
* current value of "scan", the position in the RE program.
*/
bp = (backpos_T *)backpos.ga_data;
for (i = 0; i < backpos.ga_len; ++i)
if (bp[i].bp_scan == scan)
break;
if (i == backpos.ga_len)
{
/* First time at this BACK, make room to store the pos. */
if (ga_grow(&backpos, 1) == FAIL)
status = RA_FAIL;
else
{
/* get "ga_data" again, it may have changed */
bp = (backpos_T *)backpos.ga_data;
bp[i].bp_scan = scan;
++backpos.ga_len;
}
}
else if (reg_save_equal(&bp[i].bp_pos))
/* Still at same position as last time, fail. */
status = RA_NOMATCH;
if (status != RA_FAIL && status != RA_NOMATCH)
reg_save(&bp[i].bp_pos, &backpos);
}
break; break;
case MOPEN + 0: /* Match start: \zs */ case MOPEN + 0: /* Match start: \zs */
@ -4094,7 +4129,7 @@ regmatch(scan)
{ {
no = op - MOPEN; no = op - MOPEN;
cleanup_subexpr(); cleanup_subexpr();
rp = regstack_push(&regstack, RS_MOPEN, scan, startp); rp = regstack_push(&regstack, RS_MOPEN, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
@ -4109,7 +4144,7 @@ regmatch(scan)
case NOPEN: /* \%( */ case NOPEN: /* \%( */
case NCLOSE: /* \) after \%( */ case NCLOSE: /* \) after \%( */
if (regstack_push(&regstack, RS_NOPEN, scan, startp) == NULL) if (regstack_push(&regstack, RS_NOPEN, scan) == NULL)
status = RA_FAIL; status = RA_FAIL;
/* We simply continue and handle the result when done. */ /* We simply continue and handle the result when done. */
break; break;
@ -4127,7 +4162,7 @@ regmatch(scan)
{ {
no = op - ZOPEN; no = op - ZOPEN;
cleanup_zsubexpr(); cleanup_zsubexpr();
rp = regstack_push(&regstack, RS_ZOPEN, scan, startp); rp = regstack_push(&regstack, RS_ZOPEN, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
@ -4154,7 +4189,7 @@ regmatch(scan)
{ {
no = op - MCLOSE; no = op - MCLOSE;
cleanup_subexpr(); cleanup_subexpr();
rp = regstack_push(&regstack, RS_MCLOSE, scan, startp); rp = regstack_push(&regstack, RS_MCLOSE, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
@ -4179,7 +4214,7 @@ regmatch(scan)
{ {
no = op - ZCLOSE; no = op - ZCLOSE;
cleanup_zsubexpr(); cleanup_zsubexpr();
rp = regstack_push(&regstack, RS_ZCLOSE, scan, startp); rp = regstack_push(&regstack, RS_ZCLOSE, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
@ -4355,13 +4390,9 @@ regmatch(scan)
{ {
if (OP(next) != BRANCH) /* No choice. */ if (OP(next) != BRANCH) /* No choice. */
next = OPERAND(scan); /* Avoid recursion. */ next = OPERAND(scan); /* Avoid recursion. */
else if (startp != 0 && OP(OPERAND(scan)) == BACKP
&& reg_save_equal(STARTP2REGS(startp)))
/* \+ with something empty before it */
status = RA_NOMATCH;
else else
{ {
rp = regstack_push(&regstack, RS_BRANCH, scan, startp); rp = regstack_push(&regstack, RS_BRANCH, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
@ -4411,14 +4442,13 @@ regmatch(scan)
if (brace_count[no] <= (brace_min[no] <= brace_max[no] if (brace_count[no] <= (brace_min[no] <= brace_max[no]
? brace_min[no] : brace_max[no])) ? brace_min[no] : brace_max[no]))
{ {
rp = regstack_push(&regstack, RS_BRCPLX_MORE, scan, startp); rp = regstack_push(&regstack, RS_BRCPLX_MORE, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
{ {
rp->rs_no = no; rp->rs_no = no;
reg_save(&rp->rs_un.regsave); reg_save(&rp->rs_un.regsave, &backpos);
startp = REGS2STARTP(&rp->rs_un.regsave);
next = OPERAND(scan); next = OPERAND(scan);
/* We continue and handle the result when done. */ /* We continue and handle the result when done. */
} }
@ -4431,15 +4461,13 @@ regmatch(scan)
/* Range is the normal way around, use longest match */ /* Range is the normal way around, use longest match */
if (brace_count[no] <= brace_max[no]) if (brace_count[no] <= brace_max[no])
{ {
rp = regstack_push(&regstack, RS_BRCPLX_LONG, rp = regstack_push(&regstack, RS_BRCPLX_LONG, scan);
scan, startp);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
{ {
rp->rs_no = no; rp->rs_no = no;
reg_save(&rp->rs_un.regsave); reg_save(&rp->rs_un.regsave, &backpos);
startp = REGS2STARTP(&rp->rs_un.regsave);
next = OPERAND(scan); next = OPERAND(scan);
/* We continue and handle the result when done. */ /* We continue and handle the result when done. */
} }
@ -4450,14 +4478,12 @@ regmatch(scan)
/* Range is backwards, use shortest match first */ /* Range is backwards, use shortest match first */
if (brace_count[no] <= brace_min[no]) if (brace_count[no] <= brace_min[no])
{ {
rp = regstack_push(&regstack, RS_BRCPLX_SHORT, rp = regstack_push(&regstack, RS_BRCPLX_SHORT, scan);
scan, startp);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
{ {
reg_save(&rp->rs_un.regsave); reg_save(&rp->rs_un.regsave, &backpos);
startp = REGS2STARTP(&rp->rs_un.regsave);
/* We continue and handle the result when done. */ /* We continue and handle the result when done. */
} }
} }
@ -4533,7 +4559,7 @@ regmatch(scan)
{ {
regstack.ga_len += sizeof(regstar_T); regstack.ga_len += sizeof(regstar_T);
rp = regstack_push(&regstack, rst.minval <= rst.maxval rp = regstack_push(&regstack, rst.minval <= rst.maxval
? RS_STAR_LONG : RS_STAR_SHORT, scan, startp); ? RS_STAR_LONG : RS_STAR_SHORT, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
@ -4552,13 +4578,13 @@ regmatch(scan)
case NOMATCH: case NOMATCH:
case MATCH: case MATCH:
case SUBPAT: case SUBPAT:
rp = regstack_push(&regstack, RS_NOMATCH, scan, startp); rp = regstack_push(&regstack, RS_NOMATCH, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
{ {
rp->rs_no = op; rp->rs_no = op;
reg_save(&rp->rs_un.regsave); reg_save(&rp->rs_un.regsave, &backpos);
next = OPERAND(scan); next = OPERAND(scan);
/* We continue and handle the result when done. */ /* We continue and handle the result when done. */
} }
@ -4577,13 +4603,13 @@ regmatch(scan)
else else
{ {
regstack.ga_len += sizeof(regbehind_T); regstack.ga_len += sizeof(regbehind_T);
rp = regstack_push(&regstack, RS_BEHIND1, scan, startp); rp = regstack_push(&regstack, RS_BEHIND1, scan);
if (rp == NULL) if (rp == NULL)
status = RA_FAIL; status = RA_FAIL;
else else
{ {
rp->rs_no = op; rp->rs_no = op;
reg_save(&rp->rs_un.regsave); reg_save(&rp->rs_un.regsave, &backpos);
/* First try if what follows matches. If it does then we /* First try if what follows matches. If it does then we
* check the behind match by looping. */ * check the behind match by looping. */
} }
@ -4636,7 +4662,7 @@ regmatch(scan)
/* /*
* If there is something on the regstack execute the code for the state. * If there is something on the regstack execute the code for the state.
* If the state is popped then loop. * If the state is popped then loop and use the older state.
*/ */
while (regstack.ga_len > 0 && status != RA_FAIL) while (regstack.ga_len > 0 && status != RA_FAIL)
{ {
@ -4645,7 +4671,7 @@ regmatch(scan)
{ {
case RS_NOPEN: case RS_NOPEN:
/* Result is passed on as-is, simply pop the state. */ /* Result is passed on as-is, simply pop the state. */
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
break; break;
case RS_MOPEN: case RS_MOPEN:
@ -4653,7 +4679,7 @@ regmatch(scan)
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
restore_se(&rp->rs_un.sesave, &reg_startpos[rp->rs_no], restore_se(&rp->rs_un.sesave, &reg_startpos[rp->rs_no],
&reg_startp[rp->rs_no]); &reg_startp[rp->rs_no]);
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
break; break;
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
@ -4662,7 +4688,7 @@ regmatch(scan)
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
restore_se(&rp->rs_un.sesave, &reg_startzpos[rp->rs_no], restore_se(&rp->rs_un.sesave, &reg_startzpos[rp->rs_no],
&reg_startzp[rp->rs_no]); &reg_startzp[rp->rs_no]);
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
break; break;
#endif #endif
@ -4671,7 +4697,7 @@ regmatch(scan)
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
restore_se(&rp->rs_un.sesave, &reg_endpos[rp->rs_no], restore_se(&rp->rs_un.sesave, &reg_endpos[rp->rs_no],
&reg_endp[rp->rs_no]); &reg_endp[rp->rs_no]);
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
break; break;
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
@ -4680,34 +4706,33 @@ regmatch(scan)
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
restore_se(&rp->rs_un.sesave, &reg_endzpos[rp->rs_no], restore_se(&rp->rs_un.sesave, &reg_endzpos[rp->rs_no],
&reg_endzp[rp->rs_no]); &reg_endzp[rp->rs_no]);
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
break; break;
#endif #endif
case RS_BRANCH: case RS_BRANCH:
if (status == RA_MATCH) if (status == RA_MATCH)
/* this branch matched, use it */ /* this branch matched, use it */
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
else else
{ {
if (status != RA_BREAK) if (status != RA_BREAK)
{ {
/* After a non-matching branch: try next one. */ /* After a non-matching branch: try next one. */
reg_restore(&rp->rs_un.regsave); reg_restore(&rp->rs_un.regsave, &backpos);
scan = rp->rs_scan; scan = rp->rs_scan;
} }
if (scan == NULL || OP(scan) != BRANCH) if (scan == NULL || OP(scan) != BRANCH)
{ {
/* no more branches, didn't find a match */ /* no more branches, didn't find a match */
status = RA_NOMATCH; status = RA_NOMATCH;
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
} }
else else
{ {
/* Prepare to try a branch. */ /* Prepare to try a branch. */
rp->rs_scan = regnext(scan); rp->rs_scan = regnext(scan);
reg_save(&rp->rs_un.regsave); reg_save(&rp->rs_un.regsave, &backpos);
startp = REGS2STARTP(&rp->rs_un.regsave);
scan = OPERAND(scan); scan = OPERAND(scan);
} }
} }
@ -4717,10 +4742,10 @@ regmatch(scan)
/* Pop the state. Restore pointers when there is no match. */ /* Pop the state. Restore pointers when there is no match. */
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
{ {
reg_restore(&rp->rs_un.regsave); reg_restore(&rp->rs_un.regsave, &backpos);
--brace_count[rp->rs_no]; /* decrement match count */ --brace_count[rp->rs_no]; /* decrement match count */
} }
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
break; break;
case RS_BRCPLX_LONG: case RS_BRCPLX_LONG:
@ -4728,12 +4753,12 @@ regmatch(scan)
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
{ {
/* There was no match, but we did find enough matches. */ /* There was no match, but we did find enough matches. */
reg_restore(&rp->rs_un.regsave); reg_restore(&rp->rs_un.regsave, &backpos);
--brace_count[rp->rs_no]; --brace_count[rp->rs_no];
/* continue with the items after "\{}" */ /* continue with the items after "\{}" */
status = RA_CONT; status = RA_CONT;
} }
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
if (status == RA_CONT) if (status == RA_CONT)
scan = regnext(scan); scan = regnext(scan);
break; break;
@ -4742,8 +4767,8 @@ regmatch(scan)
/* Pop the state. Restore pointers when there is no match. */ /* Pop the state. Restore pointers when there is no match. */
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
/* There was no match, try to match one more item. */ /* There was no match, try to match one more item. */
reg_restore(&rp->rs_un.regsave); reg_restore(&rp->rs_un.regsave, &backpos);
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
{ {
scan = OPERAND(scan); scan = OPERAND(scan);
@ -4760,10 +4785,10 @@ regmatch(scan)
else else
{ {
status = RA_CONT; status = RA_CONT;
if (rp->rs_no != SUBPAT) if (rp->rs_no != SUBPAT) /* zero-width */
reg_restore(&rp->rs_un.regsave); /* zero-width */ reg_restore(&rp->rs_un.regsave, &backpos);
} }
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
if (status == RA_CONT) if (status == RA_CONT)
scan = regnext(scan); scan = regnext(scan);
break; break;
@ -4771,7 +4796,7 @@ regmatch(scan)
case RS_BEHIND1: case RS_BEHIND1:
if (status == RA_NOMATCH) if (status == RA_NOMATCH)
{ {
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
regstack.ga_len -= sizeof(regbehind_T); regstack.ga_len -= sizeof(regbehind_T);
} }
else else
@ -4783,7 +4808,7 @@ regmatch(scan)
* the current position. */ * the current position. */
/* save the position after the found match for next */ /* save the position after the found match for next */
reg_save(&(((regbehind_T *)rp) - 1)->save_after); reg_save(&(((regbehind_T *)rp) - 1)->save_after, &backpos);
/* start looking for a match with operand at the current /* start looking for a match with operand at the current
* postion. Go back one character until we find the * postion. Go back one character until we find the
@ -4796,7 +4821,7 @@ regmatch(scan)
rp->rs_state = RS_BEHIND2; rp->rs_state = RS_BEHIND2;
reg_restore(&rp->rs_un.regsave); reg_restore(&rp->rs_un.regsave, &backpos);
scan = OPERAND(rp->rs_scan); scan = OPERAND(rp->rs_scan);
} }
break; break;
@ -4810,11 +4835,12 @@ regmatch(scan)
/* found a match that ends where "next" started */ /* found a match that ends where "next" started */
behind_pos = (((regbehind_T *)rp) - 1)->save_behind; behind_pos = (((regbehind_T *)rp) - 1)->save_behind;
if (rp->rs_no == BEHIND) if (rp->rs_no == BEHIND)
reg_restore(&(((regbehind_T *)rp) - 1)->save_after); reg_restore(&(((regbehind_T *)rp) - 1)->save_after,
&backpos);
else else
/* But we didn't want a match. */ /* But we didn't want a match. */
status = RA_NOMATCH; status = RA_NOMATCH;
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
regstack.ga_len -= sizeof(regbehind_T); regstack.ga_len -= sizeof(regbehind_T);
} }
else else
@ -4834,7 +4860,7 @@ regmatch(scan)
no = FAIL; no = FAIL;
else else
{ {
reg_restore(&rp->rs_un.regsave); reg_restore(&rp->rs_un.regsave, &backpos);
rp->rs_un.regsave.rs_u.pos.col = rp->rs_un.regsave.rs_u.pos.col =
(colnr_T)STRLEN(regline); (colnr_T)STRLEN(regline);
} }
@ -4852,7 +4878,7 @@ regmatch(scan)
if (no == OK) if (no == OK)
{ {
/* Advanced, prepare for finding match again. */ /* Advanced, prepare for finding match again. */
reg_restore(&rp->rs_un.regsave); reg_restore(&rp->rs_un.regsave, &backpos);
scan = OPERAND(rp->rs_scan); scan = OPERAND(rp->rs_scan);
} }
else else
@ -4861,12 +4887,13 @@ regmatch(scan)
behind_pos = (((regbehind_T *)rp) - 1)->save_behind; behind_pos = (((regbehind_T *)rp) - 1)->save_behind;
if (rp->rs_no == NOBEHIND) if (rp->rs_no == NOBEHIND)
{ {
reg_restore(&(((regbehind_T *)rp) - 1)->save_after); reg_restore(&(((regbehind_T *)rp) - 1)->save_after,
&backpos);
status = RA_MATCH; status = RA_MATCH;
} }
else else
status = RA_NOMATCH; status = RA_NOMATCH;
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
regstack.ga_len -= sizeof(regbehind_T); regstack.ga_len -= sizeof(regbehind_T);
} }
} }
@ -4879,14 +4906,14 @@ regmatch(scan)
if (status == RA_MATCH) if (status == RA_MATCH)
{ {
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
regstack.ga_len -= sizeof(regstar_T); regstack.ga_len -= sizeof(regstar_T);
break; break;
} }
/* Tried once already, restore input pointers. */ /* Tried once already, restore input pointers. */
if (status != RA_BREAK) if (status != RA_BREAK)
reg_restore(&rp->rs_un.regsave); reg_restore(&rp->rs_un.regsave, &backpos);
/* Repeat until we found a position where it could match. */ /* Repeat until we found a position where it could match. */
for (;;) for (;;)
@ -4936,7 +4963,7 @@ regmatch(scan)
if (rst->nextb == NUL || *reginput == rst->nextb if (rst->nextb == NUL || *reginput == rst->nextb
|| *reginput == rst->nextb_ic) || *reginput == rst->nextb_ic)
{ {
reg_save(&rp->rs_un.regsave); reg_save(&rp->rs_un.regsave, &backpos);
scan = regnext(rp->rs_scan); scan = regnext(rp->rs_scan);
status = RA_CONT; status = RA_CONT;
break; break;
@ -4945,7 +4972,7 @@ regmatch(scan)
if (status != RA_CONT) if (status != RA_CONT)
{ {
/* Failed. */ /* Failed. */
regstack_pop(&regstack, &scan, &startp); regstack_pop(&regstack, &scan);
regstack.ga_len -= sizeof(regstar_T); regstack.ga_len -= sizeof(regstar_T);
status = RA_NOMATCH; status = RA_NOMATCH;
} }
@ -4996,11 +5023,10 @@ regmatch(scan)
* Returns pointer to new item. Returns NULL when out of memory. * Returns pointer to new item. Returns NULL when out of memory.
*/ */
static regitem_T * static regitem_T *
regstack_push(regstack, state, scan, startp) regstack_push(regstack, state, scan)
garray_T *regstack; garray_T *regstack;
regstate_T state; regstate_T state;
char_u *scan; char_u *scan;
long startp;
{ {
regitem_T *rp; regitem_T *rp;
@ -5015,7 +5041,6 @@ regstack_push(regstack, state, scan, startp)
rp = (regitem_T *)((char *)regstack->ga_data + regstack->ga_len); rp = (regitem_T *)((char *)regstack->ga_data + regstack->ga_len);
rp->rs_state = state; rp->rs_state = state;
rp->rs_scan = scan; rp->rs_scan = scan;
rp->rs_startp = startp;
regstack->ga_len += sizeof(regitem_T); regstack->ga_len += sizeof(regitem_T);
return rp; return rp;
@ -5025,16 +5050,14 @@ regstack_push(regstack, state, scan, startp)
* Pop an item from the regstack. * Pop an item from the regstack.
*/ */
static void static void
regstack_pop(regstack, scan, startp) regstack_pop(regstack, scan)
garray_T *regstack; garray_T *regstack;
char_u **scan; char_u **scan;
long *startp;
{ {
regitem_T *rp; regitem_T *rp;
rp = (regitem_T *)((char *)regstack->ga_data + regstack->ga_len) - 1; rp = (regitem_T *)((char *)regstack->ga_data + regstack->ga_len) - 1;
*scan = rp->rs_scan; *scan = rp->rs_scan;
*startp = rp->rs_startp;
regstack->ga_len -= sizeof(regitem_T); regstack->ga_len -= sizeof(regitem_T);
} }
@ -5441,7 +5464,7 @@ regnext(p)
if (offset == 0) if (offset == 0)
return NULL; return NULL;
if (OP(p) == BACK || OP(p) == BACKP) if (OP(p) == BACK)
return p - offset; return p - offset;
else else
return p + offset; return p + offset;
@ -5526,8 +5549,9 @@ reg_nextline()
* Save the input line and position in a regsave_T. * Save the input line and position in a regsave_T.
*/ */
static void static void
reg_save(save) reg_save(save, gap)
regsave_T *save; regsave_T *save;
garray_T *gap;
{ {
if (REG_MULTI) if (REG_MULTI)
{ {
@ -5536,14 +5560,16 @@ reg_save(save)
} }
else else
save->rs_u.ptr = reginput; save->rs_u.ptr = reginput;
save->rs_len = gap->ga_len;
} }
/* /*
* Restore the input line and position from a regsave_T. * Restore the input line and position from a regsave_T.
*/ */
static void static void
reg_restore(save) reg_restore(save, gap)
regsave_T *save; regsave_T *save;
garray_T *gap;
{ {
if (REG_MULTI) if (REG_MULTI)
{ {
@ -5558,6 +5584,7 @@ reg_restore(save)
} }
else else
reginput = save->rs_u.ptr; reginput = save->rs_u.ptr;
gap->ga_len = save->rs_len;
} }
/* /*
@ -5911,9 +5938,6 @@ regprop(op)
case BACK: case BACK:
p = "BACK"; p = "BACK";
break; break;
case BACKP:
p = "BACKP";
break;
case END: case END:
p = "END"; p = "END";
break; break;

View File

@ -540,7 +540,7 @@ spell_load_file(fname)
int region = REGION_ALL; int region = REGION_ALL;
int wlen; int wlen;
winfo_T *wi; winfo_T *wi;
dword_T *dw, *edw; dword_T *dw, *edw = NULL;
nword_T *nw = NULL; nword_T *nw = NULL;
int flags; int flags;
char_u *save_sourcing_name = sourcing_name; char_u *save_sourcing_name = sourcing_name;

Binary file not shown.

View File

@ -25,3 +25,5 @@ xx Aaaa xx
xx Aaa xx xx Aaa xx
xx foobar xA xx xx foobar xA xx
xx an A xx xx an A xx
XX 9;
YY 77;

View File

@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA" #define VIM_VERSION_MEDIUM "7.0aa ALPHA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 25)" #define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 28)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 25, compiled " #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 28, compiled "