1
0
forked from aniani/vim

updated for version 7.0064

This commit is contained in:
Bram Moolenaar
2005-03-25 21:53:48 +00:00
parent a88d968da1
commit 68b76a69aa
19 changed files with 347 additions and 198 deletions

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0aa. Last change: 2005 Mar 17 *eval.txt* For Vim version 7.0aa. Last change: 2005 Mar 25
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1452,7 +1452,6 @@ did_filetype() Number TRUE if FileType autocommand event used
diff_filler( {lnum}) Number diff filler lines about {lnum} diff_filler( {lnum}) Number diff filler lines about {lnum}
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col} diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
empty( {expr}) Number TRUE if {expr} is empty empty( {expr}) Number TRUE if {expr} is empty
errorlist() List list of quickfix items
escape( {string}, {chars}) String escape {chars} in {string} with '\' escape( {string}, {chars}) String escape {chars} in {string} with '\'
eval( {string}) any evaluate {string} into its value eval( {string}) any evaluate {string} into its value
eventhandler( ) Number TRUE if inside an event handler eventhandler( ) Number TRUE if inside an event handler
@@ -1489,6 +1488,7 @@ getftime( {fname}) Number last modification time of file
getftype( {fname}) String description of type of file {fname} getftype( {fname}) String description of type of file {fname}
getline( {lnum}) String line {lnum} of current buffer getline( {lnum}) String line {lnum} of current buffer
getline( {lnum}, {end}) List lines {lnum} to {end} of current buffer getline( {lnum}, {end}) List lines {lnum} to {end} of current buffer
getqflist() List list of quickfix items
getreg( [{regname}]) String contents of register getreg( [{regname}]) String contents of register
getregtype( [{regname}]) String type of register getregtype( [{regname}]) String type of register
getwinposx() Number X coord in pixels of GUI Vim window getwinposx() Number X coord in pixels of GUI Vim window
@@ -1574,6 +1574,7 @@ serverlist() String get a list of available servers
setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val} setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val}
setcmdpos( {pos}) Number set cursor position in command-line setcmdpos( {pos}) Number set cursor position in command-line
setline( {lnum}, {line}) Number set line {lnum} to {line} setline( {lnum}, {line}) Number set line {lnum} to {line}
setqflist( {list} ) Number set list of quickfix items using {list}
setreg( {n}, {v}[, {opt}]) Number set register to value and type setreg( {n}, {v}[, {opt}]) Number set register to value and type
setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val} setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
simplify( {filename}) String simplify filename as much as possible simplify( {filename}) String simplify filename as much as possible
@@ -2023,28 +2024,6 @@ empty({expr}) *empty()*
For a long List this is much faster then comparing the length For a long List this is much faster then comparing the length
with zero. with zero.
errorlist() *errorlist()*
Returns a list with all the current quickfix errors. Each
list item is a dictionary with these entries:
bufnr number of buffer that has the file name, use
bufname() to get the name
lnum line number in the buffer (first line is 1)
col column number (first column is 1)
vcol non-zero: column number is visual column
zero: column number is byte index
nr error number
text description of the error
type type of the error, 'E', '1', etc.
valid non-zero: recognized error message
Useful application: Find pattern matches in multiple files and
do something with them: >
:vimgrep /theword/jg *.c
:for d in errorlist()
: echo bufname(d.bufnr) ':' d.lnum '=' d.text
:endfor
escape({string}, {chars}) *escape()* escape({string}, {chars}) *escape()*
Escape the characters in {chars} that occur in {string} with a Escape the characters in {chars} that occur in {string} with a
backslash. Example: > backslash. Example: >
@@ -2548,6 +2527,28 @@ getline({lnum} [, {end}])
:let lines = getline(start, end) :let lines = getline(start, end)
getqflist() *getqflist()*
Returns a list with all the current quickfix errors. Each
list item is a dictionary with these entries:
bufnr number of buffer that has the file name, use
bufname() to get the name
lnum line number in the buffer (first line is 1)
col column number (first column is 1)
vcol non-zero: column number is visual column
zero: column number is byte index
nr error number
text description of the error
type type of the error, 'E', '1', etc.
valid non-zero: recognized error message
Useful application: Find pattern matches in multiple files and
do something with them: >
:vimgrep /theword/jg *.c
:for d in getqflist()
: echo bufname(d.bufnr) ':' d.lnum '=' d.text
:endfor
getreg([{regname}]) *getreg()* getreg([{regname}]) *getreg()*
The result is a String, which is the contents of register The result is a String, which is the contents of register
{regname}. Example: > {regname}. Example: >
@@ -3590,6 +3591,34 @@ setline({lnum}, {line}) *setline()*
:call setline(5, strftime("%c")) :call setline(5, strftime("%c"))
< Note: The '[ and '] marks are not set. < Note: The '[ and '] marks are not set.
setqflist({list}) *setqflist()*
Creates a quickfix list using the items in {list}. Each item
in {list} is a dictionary. Non-dictionary items in {list} are
ignored. Each dictionary item can contain the following
entries:
filename name of a file
lnum line number in the file
col column number
pattern search pattern used to locate the error
text description of the error
The "col" and "text" entries are 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"
or "pattern" entries are present, then the item will not be
handled as an error line.
If both "pattern" and "lnum" are present then "pattern" will
be used.
Returns zero for success, -1 for failure.
This function can be used to create a quickfix list
independent of the 'errorformat' setting. Use a command like
":cc 1" to jump to the first position.
*setreg()* *setreg()*
setreg({regname}, {value} [,{options}]) setreg({regname}, {value} [,{options}])
Set the register {regname} to {value}. Set the register {regname} to {value}.

View File

@@ -4689,7 +4689,6 @@ errorformat-javac quickfix.txt /*errorformat-javac*
errorformat-multi-line quickfix.txt /*errorformat-multi-line* errorformat-multi-line quickfix.txt /*errorformat-multi-line*
errorformat-separate-filename quickfix.txt /*errorformat-separate-filename* errorformat-separate-filename quickfix.txt /*errorformat-separate-filename*
errorformats quickfix.txt /*errorformats* errorformats quickfix.txt /*errorformats*
errorlist() eval.txt /*errorlist()*
escape intro.txt /*escape* escape intro.txt /*escape*
escape() eval.txt /*escape()* escape() eval.txt /*escape()*
escape-bar version4.txt /*escape-bar* escape-bar version4.txt /*escape-bar*
@@ -4977,6 +4976,7 @@ getfsize() eval.txt /*getfsize()*
getftime() eval.txt /*getftime()* getftime() eval.txt /*getftime()*
getftype() eval.txt /*getftype()* getftype() eval.txt /*getftype()*
getline() eval.txt /*getline()* getline() eval.txt /*getline()*
getqflist() eval.txt /*getqflist()*
getreg() eval.txt /*getreg()* getreg() eval.txt /*getreg()*
getregtype() eval.txt /*getregtype()* getregtype() eval.txt /*getregtype()*
getwinposx() eval.txt /*getwinposx()* getwinposx() eval.txt /*getwinposx()*
@@ -6175,6 +6175,7 @@ set-option options.txt /*set-option*
setbufvar() eval.txt /*setbufvar()* setbufvar() eval.txt /*setbufvar()*
setcmdpos() eval.txt /*setcmdpos()* setcmdpos() eval.txt /*setcmdpos()*
setline() eval.txt /*setline()* setline() eval.txt /*setline()*
setqflist() eval.txt /*setqflist()*
setreg() eval.txt /*setreg()* setreg() eval.txt /*setreg()*
setting-guifont gui.txt /*setting-guifont* setting-guifont gui.txt /*setting-guifont*
setwinvar() eval.txt /*setwinvar()* setwinvar() eval.txt /*setwinvar()*

View File

@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 7.0aa. Last change: 2005 Mar 15 *usr_41.txt* For Vim version 7.0aa. Last change: 2005 Mar 25
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@@ -723,7 +723,7 @@ Interactive:
input() get a line from the user input() get a line from the user
inputsecret() get a line from the user without showing it inputsecret() get a line from the user without showing it
inputdialog() get a line from the user in a dialog inputdialog() get a line from the user in a dialog
inputresave save and clear typeahead inputsave() save and clear typeahead
inputrestore() restore typeahead inputrestore() restore typeahead
Vim server: Vim server:
@@ -745,7 +745,7 @@ Various:
maparg() get rhs of a mapping maparg() get rhs of a mapping
exists() check if a variable, function, etc. exists exists() check if a variable, function, etc. exists
has() check if a feature is supported in Vim has() check if a feature is supported in Vim
errorlist() list of quickfix errors getqflist() list of quickfix errors
cscope_connection() check if a cscope connection exists cscope_connection() check if a cscope connection exists
did_filetype() check if a FileType autocommand was used did_filetype() check if a FileType autocommand was used
eventhandler() check if invoked by an event handler eventhandler() check if invoked by an event handler
@@ -757,6 +757,7 @@ Various:
libcallnr() idem, returning a number libcallnr() idem, returning a number
getreg() get contents of a register getreg() get contents of a register
getregtype() get type of a register getregtype() get type of a register
setqflist() create a quickfix list
setreg() set contents and type of a register setreg() set contents and type of a register
taglist() get list of matching tags taglist() get list of matching tags

View File

@@ -1,7 +1,7 @@
" Vim support file to switch on loading plugins for file types " Vim support file to switch on loading plugins for file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2004 Nov 22 " Last change: 2005 Mar 25
if exists("did_load_ftplugin") if exists("did_load_ftplugin")
finish finish
@@ -11,11 +11,11 @@ let did_load_ftplugin = 1
augroup filetypeplugin augroup filetypeplugin
au FileType * call s:LoadFTPlugin() au FileType * call s:LoadFTPlugin()
func! s:LoadFTPlugin() func! s:LoadFTPlugin()
if expand("<amatch>") != ""
if exists("b:undo_ftplugin") if exists("b:undo_ftplugin")
exe b:undo_ftplugin exe b:undo_ftplugin
unlet! b:undo_ftplugin b:did_ftplugin unlet! b:undo_ftplugin b:did_ftplugin
endif endif
if expand("<amatch>") != ""
if &cpo =~# "S" && exists("b:did_ftplugin") if &cpo =~# "S" && exists("b:did_ftplugin")
" In compatible mode options are reset to the global values, need to " In compatible mode options are reset to the global values, need to
" set the local values also when a plugin was already used. " set the local values also when a plugin was already used.

View File

@@ -48,7 +48,7 @@ menutrans &Paste<Tab>"+gP 붙이기(&P)<Tab>"+gP
menutrans Put\ &Before<Tab>[p 앞에\ 붙이기(&B)<Tab>[p menutrans Put\ &Before<Tab>[p 앞에\ 붙이기(&B)<Tab>[p
menutrans Put\ &After<Tab>]p 뒤에\ 붙이기(&A)<Tab>]p menutrans Put\ &After<Tab>]p 뒤에\ 붙이기(&A)<Tab>]p
menutrans &Delete<Tab>x 지우기(&D)<Tab>x menutrans &Delete<Tab>x 지우기(&D)<Tab>x
menutrans &Select\ all<Tab>ggVG 모두\ 고르기(&S)<Tab>ggVG menutrans &Select\ All<Tab>ggVG 모두\ 고르기(&S)<Tab>ggVG
menutrans &Find\.\.\. 찾기(&F)\.\.\. menutrans &Find\.\.\. 찾기(&F)\.\.\.
menutrans Find\ and\ Rep&lace\.\.\. 찾아서\ 바꾸기(&l)\.\.\. menutrans Find\ and\ Rep&lace\.\.\. 찾아서\ 바꾸기(&l)\.\.\.
menutrans Settings\ &Window 설정\ (&W) menutrans Settings\ &Window 설정\ (&W)
@@ -229,7 +229,7 @@ endif
" Syntax menu " Syntax menu
menutrans &Syntax 문법(&S) menutrans &Syntax 문법(&S)
menutrans &Show\ individual\ choices 모든\ 선택가능한\ 항목\ 보기(&S) menutrans &Show\ filetypes\ in\ menu 모든\ 선택가능한\ 항목\ 보기(&S)
menutrans Set\ '&syntax'\ only 'syntax'\ 설정(&s) menutrans Set\ '&syntax'\ only 'syntax'\ 설정(&s)
menutrans Set\ '&filetype'\ too 'filetype'\ 설정(&f) menutrans Set\ '&filetype'\ too 'filetype'\ 설정(&f)
menutrans &Off 끄기(&O) menutrans &Off 끄기(&O)

View File

@@ -1,6 +1,6 @@
# Language: English # Language: English
# Maintainer: Charles E. Campbell, Jr. <charles.e.campbell.1@gsfc.nasa.gov> # Maintainer: Charles E. Campbell, Jr. <charles.e.campbell.1@gsfc.nasa.gov>
# Last Change: 2005 Mar 22 # Last Change: 2005 Mar 23
a a
aardvark aardvark
aardvarks aardvarks
@@ -186689,6 +186689,7 @@ you're
you've you've
MS-Windows MS-Windows
MS-DOS MS-DOS
Ltd.
# What may come after any word # What may come after any word
+'s +'s

View File

@@ -2,7 +2,7 @@
" Language: Mail file " Language: Mail file
" Previous Maintainer: Felix von Leitner <leitner@math.fu-berlin.de> " Previous Maintainer: Felix von Leitner <leitner@math.fu-berlin.de>
" Maintainer: Gautam Iyer <gautam@math.uchicago.edu> " Maintainer: Gautam Iyer <gautam@math.uchicago.edu>
" Last Change: Thu 10 Feb 2005 09:46:26 AM CST " Last Change: 2005 Mar 23
" Quit when a syntax file was already loaded " Quit when a syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@@ -36,14 +36,14 @@ syn match mailHeaderKey contained "\v(^(\> ?)*)@<=date:"
syn match mailSubject contained "\v(^(\> ?)*)@<=subject:.*$" syn match mailSubject contained "\v(^(\> ?)*)@<=subject:.*$"
" Anything in the header between < and > is an email address " Anything in the header between < and > is an email address
syn match mailHeaderEmail contained "<.\{-}>" syn match mailHeaderEmail contained "<.\{-}>" contains=@NoSpell
" Mail Signatures. (Begin with "-- ", end with change in quote level) " Mail Signatures. (Begin with "-- ", end with change in quote level)
syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps start="^\z(\(> \?\)*\)-- $" end="^\z1$" end="^\z1\@!"me=s-1 end="^\z1\(> \?\)\+"me=s-1 syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps start="^\z(\(> \?\)*\)-- $" end="^\z1$" end="^\z1\@!"me=s-1 end="^\z1\(> \?\)\+"me=s-1
" URLs start with a known protocol or www,web,w3. " URLs start with a known protocol or www,web,w3.
syn match mailURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-z0-9/]` syn match mailURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-z0-9/]` contains=@NoSpell
syn match mailEmail "\v[_=a-z\./+0-9-]+\@[a-z0-9._-]+\a{2}" syn match mailEmail "\v[_=a-z\./+0-9-]+\@[a-z0-9._-]+\a{2}" contains=@NoSpell
" Make sure quote markers in regions (header / signature) have correct color " Make sure quote markers in regions (header / signature) have correct color
syn match mailQuoteExp1 contained "\v^(\> ?)" syn match mailQuoteExp1 contained "\v^(\> ?)"

View File

@@ -2,8 +2,8 @@
" Language: shell (sh) Korn shell (ksh) bash (sh) " Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
" Last Change: Mar 02, 2005 " Last Change: Mar 24, 2005
" Version: 73 " Version: 74
" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
" "
" Using the following VIM variables: {{{1 " Using the following VIM variables: {{{1
@@ -169,7 +169,7 @@ endif
" ==== " ====
syn match shCaseBar contained skipwhite "[^|"`'()]\{-}|"hs=e nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote syn match shCaseBar contained skipwhite "[^|"`'()]\{-}|"hs=e nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar
syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="[^$()]\{-})"ms=s,hs=e end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,,shComment syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="[^#$()]\{-})"ms=s,hs=e end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,,shComment
syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
if exists("b:is_bash") if exists("b:is_bash")

View File

@@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: Vim spell file " Language: Vim spell file
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Mar 22 " Last Change: 2005 Mar 24
" Quit when a syntax file was already loaded " Quit when a syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@@ -11,7 +11,7 @@ endif
syn match vimspellError ".*" syn match vimspellError ".*"
syn match vimspellRegion "^---$" syn match vimspellRegion "^---$"
syn match vimspellRegion "^\(-\l\l\)\+$" syn match vimspellRegion "^\(-\l\l\)\+$"
syn match vimspellOK "^!\=[>+]\=[[:alpha:]]\S*" syn match vimspellOK "^!\=[>+]\=[[:alpha:]].*"
syn match vimspellOK "^!\=+\S*" syn match vimspellOK "^!\=+\S*"
syn match vimspellError "\s\+$" syn match vimspellError "\s\+$"
syn match vimspellOK "^$" syn match vimspellOK "^$"

View File

@@ -244,7 +244,6 @@ edit(cmdchar, startln, count)
int lastc; int lastc;
colnr_T mincol; colnr_T mincol;
static linenr_T o_lnum = 0; static linenr_T o_lnum = 0;
static int o_eol = FALSE;
int i; int i;
int did_backspace = TRUE; /* previous char was backspace */ int did_backspace = TRUE; /* previous char was backspace */
#ifdef FEAT_CINDENT #ifdef FEAT_CINDENT
@@ -426,7 +425,7 @@ edit(cmdchar, startln, count)
*/ */
validate_virtcol(); validate_virtcol();
update_curswant(); update_curswant();
if (((o_eol && curwin->w_cursor.lnum == o_lnum) if (((ins_at_eol && curwin->w_cursor.lnum == o_lnum)
|| curwin->w_curswant > curwin->w_virtcol) || curwin->w_curswant > curwin->w_virtcol)
&& *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL) && *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL)
{ {
@@ -441,7 +440,7 @@ edit(cmdchar, startln, count)
} }
#endif #endif
} }
o_eol = FALSE; ins_at_eol = FALSE;
} }
else else
arrow_used = FALSE; arrow_used = FALSE;
@@ -713,11 +712,9 @@ edit(cmdchar, startln, count)
switch (c) switch (c)
{ {
case K_LEFT: c = K_RIGHT; break; case K_LEFT: c = K_RIGHT; break;
case K_XLEFT: c = K_XRIGHT; break;
case K_S_LEFT: c = K_S_RIGHT; break; case K_S_LEFT: c = K_S_RIGHT; break;
case K_C_LEFT: c = K_C_RIGHT; break; case K_C_LEFT: c = K_C_RIGHT; break;
case K_RIGHT: c = K_LEFT; break; case K_RIGHT: c = K_LEFT; break;
case K_XRIGHT: c = K_XLEFT; break;
case K_S_RIGHT: c = K_S_LEFT; break; case K_S_RIGHT: c = K_S_LEFT; break;
case K_C_RIGHT: c = K_C_LEFT; break; case K_C_RIGHT: c = K_C_LEFT; break;
} }
@@ -816,10 +813,10 @@ edit(cmdchar, startln, count)
restart_edit = 'I'; restart_edit = 'I';
#ifdef FEAT_VIRTUALEDIT #ifdef FEAT_VIRTUALEDIT
if (virtual_active()) if (virtual_active())
o_eol = FALSE; /* cursor always keeps its column */ ins_at_eol = FALSE; /* cursor always keeps its column */
else else
#endif #endif
o_eol = (gchar_cursor() == NUL); ins_at_eol = (gchar_cursor() == NUL);
goto doESCkey; goto doESCkey;
#ifdef FEAT_SNIFF #ifdef FEAT_SNIFF
@@ -888,7 +885,7 @@ doESCkey:
#endif #endif
/* Always update o_lnum, so that a "CTRL-O ." that adds a line /* Always update o_lnum, so that a "CTRL-O ." that adds a line
* still puts the cursor back after the inserted text. */ * still puts the cursor back after the inserted text. */
if (o_eol && gchar_cursor() == NUL) if (ins_at_eol && gchar_cursor() == NUL)
o_lnum = curwin->w_cursor.lnum; o_lnum = curwin->w_cursor.lnum;
if (ins_esc(&count, cmdchar)) if (ins_esc(&count, cmdchar))
@@ -1098,7 +1095,6 @@ doESCkey:
case K_HOME: case K_HOME:
case K_KHOME: case K_KHOME:
case K_XHOME:
case K_S_HOME: case K_S_HOME:
case K_C_HOME: case K_C_HOME:
ins_home(c); ins_home(c);
@@ -1106,14 +1102,12 @@ doESCkey:
case K_END: case K_END:
case K_KEND: case K_KEND:
case K_XEND:
case K_S_END: case K_S_END:
case K_C_END: case K_C_END:
ins_end(c); ins_end(c);
break; break;
case K_LEFT: case K_LEFT:
case K_XLEFT:
if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)) if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL))
ins_s_left(); ins_s_left();
else else
@@ -1126,7 +1120,6 @@ doESCkey:
break; break;
case K_RIGHT: case K_RIGHT:
case K_XRIGHT:
if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)) if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL))
ins_s_right(); ins_s_right();
else else
@@ -1139,7 +1132,6 @@ doESCkey:
break; break;
case K_UP: case K_UP:
case K_XUP:
if (mod_mask & MOD_MASK_SHIFT) if (mod_mask & MOD_MASK_SHIFT)
ins_pageup(); ins_pageup();
else else
@@ -1153,7 +1145,6 @@ doESCkey:
break; break;
case K_DOWN: case K_DOWN:
case K_XDOWN:
if (mod_mask & MOD_MASK_SHIFT) if (mod_mask & MOD_MASK_SHIFT)
ins_pagedown(); ins_pagedown();
else else
@@ -6243,14 +6234,12 @@ ins_ctrl_g()
{ {
/* CTRL-G k and CTRL-G <Up>: cursor up to Insstart.col */ /* CTRL-G k and CTRL-G <Up>: cursor up to Insstart.col */
case K_UP: case K_UP:
case K_XUP:
case Ctrl_K: case Ctrl_K:
case 'k': ins_up(TRUE); case 'k': ins_up(TRUE);
break; break;
/* CTRL-G j and CTRL-G <Down>: cursor down to Insstart.col */ /* CTRL-G j and CTRL-G <Down>: cursor down to Insstart.col */
case K_DOWN: case K_DOWN:
case K_XDOWN:
case Ctrl_J: case Ctrl_J:
case 'j': ins_down(TRUE); case 'j': ins_down(TRUE);
break; break;
@@ -6473,17 +6462,11 @@ ins_start_select(c)
switch (c) switch (c)
{ {
case K_KHOME: case K_KHOME:
case K_XHOME:
case K_KEND: case K_KEND:
case K_XEND:
case K_PAGEUP: case K_PAGEUP:
case K_KPAGEUP: case K_KPAGEUP:
case K_PAGEDOWN: case K_PAGEDOWN:
case K_KPAGEDOWN: case K_KPAGEDOWN:
case K_XLEFT:
case K_XRIGHT:
case K_XUP:
case K_XDOWN:
# ifdef MACOS # ifdef MACOS
case K_LEFT: case K_LEFT:
case K_RIGHT: case K_RIGHT:

View File

@@ -326,11 +326,9 @@ getcmdline(firstc, count, indent)
switch (c) switch (c)
{ {
case K_RIGHT: c = K_LEFT; break; case K_RIGHT: c = K_LEFT; break;
case K_XRIGHT: c = K_XLEFT; break;
case K_S_RIGHT: c = K_S_LEFT; break; case K_S_RIGHT: c = K_S_LEFT; break;
case K_C_RIGHT: c = K_C_LEFT; break; case K_C_RIGHT: c = K_C_LEFT; break;
case K_LEFT: c = K_RIGHT; break; case K_LEFT: c = K_RIGHT; break;
case K_XLEFT: c = K_XRIGHT; break;
case K_S_LEFT: c = K_S_RIGHT; break; case K_S_LEFT: c = K_S_RIGHT; break;
case K_C_LEFT: c = K_C_RIGHT; break; case K_C_LEFT: c = K_C_RIGHT; break;
} }
@@ -363,10 +361,10 @@ getcmdline(firstc, count, indent)
* list */ * list */
if (lookfor != NULL if (lookfor != NULL
&& c != K_S_DOWN && c != K_S_UP && c != K_S_DOWN && c != K_S_UP
&& c != K_DOWN && c != K_UP && c != K_XDOWN && c != K_XUP && c != K_DOWN && c != K_UP
&& c != K_PAGEDOWN && c != K_PAGEUP && c != K_PAGEDOWN && c != K_PAGEUP
&& c != K_KPAGEDOWN && c != K_KPAGEUP && c != K_KPAGEDOWN && c != K_KPAGEUP
&& c != K_LEFT && c != K_RIGHT && c != K_XLEFT && c != K_XRIGHT && c != K_LEFT && c != K_RIGHT
&& (xpc.xp_numfiles > 0 || (c != Ctrl_P && c != Ctrl_N))) && (xpc.xp_numfiles > 0 || (c != Ctrl_P && c != Ctrl_N)))
{ {
vim_free(lookfor); vim_free(lookfor);
@@ -384,9 +382,9 @@ getcmdline(firstc, count, indent)
/* Special translations for 'wildmenu' */ /* Special translations for 'wildmenu' */
if (did_wild_list && p_wmnu) if (did_wild_list && p_wmnu)
{ {
if (c == K_LEFT || c == K_XLEFT) if (c == K_LEFT)
c = Ctrl_P; c = Ctrl_P;
else if (c == K_RIGHT || c == K_XRIGHT) else if (c == K_RIGHT)
c = Ctrl_N; c = Ctrl_N;
} }
/* Hitting CR after "emenu Name.": complete submenu */ /* Hitting CR after "emenu Name.": complete submenu */
@@ -407,8 +405,7 @@ getcmdline(firstc, count, indent)
(void)ExpandOne(&xpc, NULL, NULL, 0, WILD_FREE); (void)ExpandOne(&xpc, NULL, NULL, 0, WILD_FREE);
did_wild_list = FALSE; did_wild_list = FALSE;
#ifdef FEAT_WILDMENU #ifdef FEAT_WILDMENU
if (!p_wmnu || (c != K_UP && c != K_DOWN if (!p_wmnu || (c != K_UP && c != K_DOWN))
&& c != K_XUP && c != K_XDOWN))
#endif #endif
xpc.xp_context = EXPAND_NOTHING; xpc.xp_context = EXPAND_NOTHING;
wim_index = 0; wim_index = 0;
@@ -455,10 +452,9 @@ getcmdline(firstc, count, indent)
if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu) if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu)
{ {
/* Hitting <Down> after "emenu Name.": complete submenu */ /* Hitting <Down> after "emenu Name.": complete submenu */
if (ccline.cmdbuff[ccline.cmdpos - 1] == '.' if (ccline.cmdbuff[ccline.cmdpos - 1] == '.' && c == K_DOWN)
&& (c == K_DOWN || c == K_XDOWN))
c = p_wc; c = p_wc;
else if (c == K_UP || c == K_XUP) else if (c == K_UP)
{ {
/* Hitting <Up>: Remove one submenu name in front of the /* Hitting <Up>: Remove one submenu name in front of the
* cursor */ * cursor */
@@ -505,15 +501,14 @@ getcmdline(firstc, count, indent)
upseg[4] = NUL; upseg[4] = NUL;
if (ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP if (ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP
&& (c == K_DOWN || c == K_XDOWN) && c == K_DOWN
&& (ccline.cmdbuff[ccline.cmdpos - 2] != '.' && (ccline.cmdbuff[ccline.cmdpos - 2] != '.'
|| ccline.cmdbuff[ccline.cmdpos - 3] != '.')) || ccline.cmdbuff[ccline.cmdpos - 3] != '.'))
{ {
/* go down a directory */ /* go down a directory */
c = p_wc; c = p_wc;
} }
else if (STRNCMP(xpc.xp_pattern, upseg + 1, 3) == 0 else if (STRNCMP(xpc.xp_pattern, upseg + 1, 3) == 0 && c == K_DOWN)
&& (c == K_DOWN || c == K_XDOWN))
{ {
/* If in a direct ancestor, strip off one ../ to go down */ /* If in a direct ancestor, strip off one ../ to go down */
int found = FALSE; int found = FALSE;
@@ -541,7 +536,7 @@ getcmdline(firstc, count, indent)
c = p_wc; c = p_wc;
} }
} }
else if (c == K_UP || c == K_XUP) else if (c == K_UP)
{ {
/* go up a directory */ /* go up a directory */
int found = FALSE; int found = FALSE;
@@ -1107,7 +1102,6 @@ getcmdline(firstc, count, indent)
continue; /* don't do incremental search now */ continue; /* don't do incremental search now */
case K_RIGHT: case K_RIGHT:
case K_XRIGHT:
case K_S_RIGHT: case K_S_RIGHT:
case K_C_RIGHT: case K_C_RIGHT:
do do
@@ -1136,7 +1130,6 @@ getcmdline(firstc, count, indent)
goto cmdline_not_changed; goto cmdline_not_changed;
case K_LEFT: case K_LEFT:
case K_XLEFT:
case K_S_LEFT: case K_S_LEFT:
case K_C_LEFT: case K_C_LEFT:
do do
@@ -1296,7 +1289,6 @@ getcmdline(firstc, count, indent)
case Ctrl_B: /* begin of command line */ case Ctrl_B: /* begin of command line */
case K_HOME: case K_HOME:
case K_KHOME: case K_KHOME:
case K_XHOME:
case K_S_HOME: case K_S_HOME:
case K_C_HOME: case K_C_HOME:
ccline.cmdpos = 0; ccline.cmdpos = 0;
@@ -1306,7 +1298,6 @@ getcmdline(firstc, count, indent)
case Ctrl_E: /* end of command line */ case Ctrl_E: /* end of command line */
case K_END: case K_END:
case K_KEND: case K_KEND:
case K_XEND:
case K_S_END: case K_S_END:
case K_C_END: case K_C_END:
ccline.cmdpos = ccline.cmdlen; ccline.cmdpos = ccline.cmdlen;
@@ -1335,9 +1326,7 @@ getcmdline(firstc, count, indent)
#ifdef FEAT_CMDHIST #ifdef FEAT_CMDHIST
case K_UP: case K_UP:
case K_XUP:
case K_DOWN: case K_DOWN:
case K_XDOWN:
case K_S_UP: case K_S_UP:
case K_S_DOWN: case K_S_DOWN:
case K_PAGEUP: case K_PAGEUP:
@@ -1361,7 +1350,7 @@ getcmdline(firstc, count, indent)
for (;;) for (;;)
{ {
/* one step backwards */ /* one step backwards */
if (c == K_UP || c == K_XUP || c == K_S_UP || c == Ctrl_P if (c == K_UP|| c == K_S_UP || c == Ctrl_P
|| c == K_PAGEUP || c == K_KPAGEUP) || c == K_PAGEUP || c == K_KPAGEUP)
{ {
if (hiscnt == hislen) /* first time */ if (hiscnt == hislen) /* first time */
@@ -1398,7 +1387,7 @@ getcmdline(firstc, count, indent)
hiscnt = i; hiscnt = i;
break; break;
} }
if ((c != K_UP && c != K_DOWN && c != K_XUP && c != K_XDOWN) if ((c != K_UP && c != K_DOWN)
|| hiscnt == i || hiscnt == i
|| STRNCMP(history[histype][hiscnt].hisstr, || STRNCMP(history[histype][hiscnt].hisstr,
lookfor, (size_t)j) == 0) lookfor, (size_t)j) == 0)

View File

@@ -63,7 +63,7 @@ EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
/* /*
* When vgetc() is called, it sets mod_mask to the set of modifiers that are * When vgetc() is called, it sets mod_mask to the set of modifiers that are
* held down based on the KSMOD_* symbols that are read first. * held down based on the MOD_MASK_* symbols that are read first.
*/ */
EXTERN int mod_mask INIT(= 0x0); /* current key modifiers */ EXTERN int mod_mask INIT(= 0x0); /* current key modifiers */
@@ -806,6 +806,8 @@ EXTERN int arrow_used; /* Normally FALSE, set to TRUE after
* hitting cursor key in insert mode. * hitting cursor key in insert mode.
* Used by vgetorpeek() to decide when * Used by vgetorpeek() to decide when
* to call u_sync() */ * to call u_sync() */
EXTERN int ins_at_eol INIT(= FALSE); /* put cursor after eol when
restarting edit after CTRL-O */
#ifdef FEAT_INS_EXPAND #ifdef FEAT_INS_EXPAND
EXTERN char_u *edit_submode INIT(= NULL); /* msg for CTRL-X submode */ EXTERN char_u *edit_submode INIT(= NULL); /* msg for CTRL-X submode */
EXTERN char_u *edit_submode_pre INIT(= NULL); /* prepended to edit_submode */ EXTERN char_u *edit_submode_pre INIT(= NULL); /* prepended to edit_submode */

View File

@@ -206,7 +206,9 @@ enum key_extra
, KE_XF3 , KE_XF3
, KE_XF4 , KE_XF4
, KE_XEND /* extra (vt100) end key for xterm */ , KE_XEND /* extra (vt100) end key for xterm */
, KE_ZEND /* extra (vt100) end key for xterm */
, KE_XHOME /* extra (vt100) home key for xterm */ , KE_XHOME /* extra (vt100) home key for xterm */
, KE_ZHOME /* extra (vt100) home key for xterm */
, KE_XUP /* extra vt100 cursor keys for xterm */ , KE_XUP /* extra vt100 cursor keys for xterm */
, KE_XDOWN , KE_XDOWN
, KE_XLEFT , KE_XLEFT
@@ -381,9 +383,11 @@ enum key_extra
#define K_HOME TERMCAP2KEY('k', 'h') #define K_HOME TERMCAP2KEY('k', 'h')
#define K_KHOME TERMCAP2KEY('K', '1') /* keypad home (upper left) */ #define K_KHOME TERMCAP2KEY('K', '1') /* keypad home (upper left) */
#define K_XHOME TERMCAP2KEY(KS_EXTRA, KE_XHOME) #define K_XHOME TERMCAP2KEY(KS_EXTRA, KE_XHOME)
#define K_ZHOME TERMCAP2KEY(KS_EXTRA, KE_ZHOME)
#define K_END TERMCAP2KEY('@', '7') #define K_END TERMCAP2KEY('@', '7')
#define K_KEND TERMCAP2KEY('K', '4') /* keypad end (lower left) */ #define K_KEND TERMCAP2KEY('K', '4') /* keypad end (lower left) */
#define K_XEND TERMCAP2KEY(KS_EXTRA, KE_XEND) #define K_XEND TERMCAP2KEY(KS_EXTRA, KE_XEND)
#define K_ZEND TERMCAP2KEY(KS_EXTRA, KE_ZEND)
#define K_PAGEUP TERMCAP2KEY('k', 'P') #define K_PAGEUP TERMCAP2KEY('k', 'P')
#define K_PAGEDOWN TERMCAP2KEY('k', 'N') #define K_PAGEDOWN TERMCAP2KEY('k', 'N')
#define K_KPAGEUP TERMCAP2KEY('K', '3') /* keypad pageup (upper R.) */ #define K_KPAGEUP TERMCAP2KEY('K', '3') /* keypad pageup (upper R.) */
@@ -407,13 +411,6 @@ enum key_extra
#define K_K8 TERMCAP2KEY('K', 'K') /* keypad 8 */ #define K_K8 TERMCAP2KEY('K', 'K') /* keypad 8 */
#define K_K9 TERMCAP2KEY('K', 'L') /* keypad 9 */ #define K_K9 TERMCAP2KEY('K', 'L') /* keypad 9 */
/*
* These are used to recognize a keypad key that does have an ASCII equivalent.
* Since the values are negative, it's the other way around.
*/
#define FIRST_KEYPAD K_K9
#define LAST_KEYPAD K_KPLUS
#define K_MOUSE TERMCAP2KEY(KS_MOUSE, KE_FILLER) #define K_MOUSE TERMCAP2KEY(KS_MOUSE, KE_FILLER)
#define K_MENU TERMCAP2KEY(KS_MENU, KE_FILLER) #define K_MENU TERMCAP2KEY(KS_MENU, KE_FILLER)
#define K_VER_SCROLLBAR TERMCAP2KEY(KS_VER_SCROLLBAR, KE_FILLER) #define K_VER_SCROLLBAR TERMCAP2KEY(KS_VER_SCROLLBAR, KE_FILLER)

View File

@@ -1843,9 +1843,11 @@ static struct key_name_entry
{K_HOME, (char_u *)"Home"}, {K_HOME, (char_u *)"Home"},
{K_KHOME, (char_u *)"kHome"}, {K_KHOME, (char_u *)"kHome"},
{K_XHOME, (char_u *)"xHome"}, {K_XHOME, (char_u *)"xHome"},
{K_ZHOME, (char_u *)"zHome"},
{K_END, (char_u *)"End"}, {K_END, (char_u *)"End"},
{K_KEND, (char_u *)"kEnd"}, {K_KEND, (char_u *)"kEnd"},
{K_XEND, (char_u *)"xEnd"}, {K_XEND, (char_u *)"xEnd"},
{K_ZEND, (char_u *)"zEnd"},
{K_PAGEUP, (char_u *)"PageUp"}, {K_PAGEUP, (char_u *)"PageUp"},
{K_PAGEDOWN, (char_u *)"PageDown"}, {K_PAGEDOWN, (char_u *)"PageDown"},
{K_KPAGEUP, (char_u *)"kPageUp"}, {K_KPAGEUP, (char_u *)"kPageUp"},
@@ -1999,8 +2001,6 @@ simplify_key(key, modifiers)
/* /*
* Change <xHome> to <Home>, <xUp> to <Up>, etc. * Change <xHome> to <Home>, <xUp> to <Up>, etc.
* "kp" must point to an array that holds the two characters that represent a
* special key.
*/ */
int int
handle_x_keys(key) handle_x_keys(key)
@@ -2013,7 +2013,9 @@ handle_x_keys(key)
case K_XLEFT: return K_LEFT; case K_XLEFT: return K_LEFT;
case K_XRIGHT: return K_RIGHT; case K_XRIGHT: return K_RIGHT;
case K_XHOME: return K_HOME; case K_XHOME: return K_HOME;
case K_ZHOME: return K_HOME;
case K_XEND: return K_END; case K_XEND: return K_END;
case K_ZEND: return K_END;
case K_XF1: return K_F1; case K_XF1: return K_F1;
case K_XF2: return K_F2; case K_XF2: return K_F2;
case K_XF3: return K_F3; case K_XF3: return K_F3;

View File

@@ -39,6 +39,8 @@ char_u *get_user_var_name __ARGS((expand_T *xp, int idx));
int list_append_dict __ARGS((list_T *list, dict_T *dict)); int list_append_dict __ARGS((list_T *list, dict_T *dict));
dict_T *dict_alloc __ARGS((void)); dict_T *dict_alloc __ARGS((void));
int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str)); int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
char_u *get_dict_string __ARGS((dict_T *d, char_u *key));
long get_dict_number __ARGS((dict_T *d, char_u *key));
char_u *get_function_name __ARGS((expand_T *xp, int idx)); char_u *get_function_name __ARGS((expand_T *xp, int idx));
char_u *get_expr_name __ARGS((expand_T *xp, int idx)); char_u *get_expr_name __ARGS((expand_T *xp, int idx));
void set_vim_var_nr __ARGS((int idx, long val)); void set_vim_var_nr __ARGS((int idx, long val));

View File

@@ -24,16 +24,18 @@ struct dir_stack_T
static struct dir_stack_T *dir_stack = NULL; static struct dir_stack_T *dir_stack = NULL;
/* /*
* for each error the next struct is allocated and linked in a list * For each error the next struct is allocated and linked in a list.
*/ */
struct qf_line typedef struct qfline_S qfline_T;
struct qfline_S
{ {
struct qf_line *qf_next; /* pointer to next error in the list */ qfline_T *qf_next; /* pointer to next error in the list */
struct qf_line *qf_prev; /* pointer to previous error in the list */ qfline_T *qf_prev; /* pointer to previous error in the list */
linenr_T qf_lnum; /* line number where the error occurred */ linenr_T qf_lnum; /* line number where the error occurred */
int qf_fnum; /* file number for the line */ int qf_fnum; /* file number for the line */
int qf_col; /* column where the error occurred */ int qf_col; /* column where the error occurred */
int qf_nr; /* error number */ int qf_nr; /* error number */
char_u *qf_pattern; /* search pattern for the error */
char_u *qf_text; /* description of the error */ char_u *qf_text; /* description of the error */
char_u qf_viscol; /* set to TRUE if qf_col is screen column */ char_u qf_viscol; /* set to TRUE if qf_col is screen column */
char_u qf_cleared; /* set to TRUE if line has been deleted */ char_u qf_cleared; /* set to TRUE if line has been deleted */
@@ -49,8 +51,8 @@ struct qf_line
struct qf_list struct qf_list
{ {
struct qf_line *qf_start; /* pointer to the first error */ qfline_T *qf_start; /* pointer to the first error */
struct qf_line *qf_ptr; /* pointer to the current error */ qfline_T *qf_ptr; /* pointer to the current error */
int qf_count; /* number of errors (0 means no error list) */ int qf_count; /* number of errors (0 means no error list) */
int qf_index; /* current index in the error list */ int qf_index; /* current index in the error list */
int qf_nonevalid; /* TRUE if not a single valid entry found */ int qf_nonevalid; /* TRUE if not a single valid entry found */
@@ -59,7 +61,7 @@ struct qf_list
static int qf_curlist = 0; /* current error list */ static int qf_curlist = 0; /* current error list */
static int qf_listcount = 0; /* current number of lists */ static int qf_listcount = 0; /* current number of lists */
#define FMT_PATTERNS 9 /* maximum number of % recognized */ #define FMT_PATTERNS 10 /* maximum number of % recognized */
/* /*
* Structure used to hold the info of one part of 'errorformat' * Structure used to hold the info of one part of 'errorformat'
@@ -88,7 +90,7 @@ struct eformat
static int qf_init_ext __ARGS((char_u *efile, buf_T *buf, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast)); static int qf_init_ext __ARGS((char_u *efile, buf_T *buf, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast));
static void qf_new_list __ARGS((void)); static void qf_new_list __ARGS((void));
static int qf_add_entry __ARGS((struct qf_line **prevp, char_u *dir, char_u *fname, char_u *mesg, long lnum, int col, int vis_col, int nr, int type, int valid)); static int qf_add_entry __ARGS((qfline_T **prevp, char_u *dir, char_u *fname, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid));
static void qf_msg __ARGS((void)); static void qf_msg __ARGS((void));
static void qf_free __ARGS((int idx)); static void qf_free __ARGS((int idx));
static char_u *qf_types __ARGS((int, int)); static char_u *qf_types __ARGS((int, int));
@@ -145,6 +147,7 @@ qf_init_ext(efile, buf, errorformat, newlist, lnumfirst, lnumlast)
{ {
char_u *namebuf; char_u *namebuf;
char_u *errmsg; char_u *errmsg;
char_u *pattern;
char_u *fmtstr = NULL; char_u *fmtstr = NULL;
int col = 0; int col = 0;
char_u use_viscol = FALSE; char_u use_viscol = FALSE;
@@ -154,7 +157,7 @@ qf_init_ext(efile, buf, errorformat, newlist, lnumfirst, lnumlast)
long lnum = 0L; long lnum = 0L;
int enr = 0; int enr = 0;
FILE *fd = NULL; FILE *fd = NULL;
struct qf_line *qfprev = NULL; /* init to make SASC shut up */ qfline_T *qfprev = NULL; /* init to make SASC shut up */
char_u *efmp; char_u *efmp;
struct eformat *fmt_first = NULL; struct eformat *fmt_first = NULL;
struct eformat *fmt_last = NULL; struct eformat *fmt_last = NULL;
@@ -189,12 +192,14 @@ qf_init_ext(efile, buf, errorformat, newlist, lnumfirst, lnumlast)
{'m', ".\\+"}, {'m', ".\\+"},
{'r', ".*"}, {'r', ".*"},
{'p', "[- .]*"}, {'p', "[- .]*"},
{'v', "\\d\\+"} {'v', "\\d\\+"},
{'s', ".\\+"}
}; };
namebuf = alloc(CMDBUFFSIZE + 1); namebuf = alloc(CMDBUFFSIZE + 1);
errmsg = alloc(CMDBUFFSIZE + 1); errmsg = alloc(CMDBUFFSIZE + 1);
if (namebuf == NULL || errmsg == NULL) pattern = alloc(CMDBUFFSIZE + 1);
if (namebuf == NULL || errmsg == NULL || pattern == NULL)
goto qf_init_end; goto qf_init_end;
if (efile != NULL && (fd = mch_fopen((char *)efile, "r")) == NULL) if (efile != NULL && (fd = mch_fopen((char *)efile, "r")) == NULL)
@@ -463,6 +468,7 @@ restofline:
if (multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL) if (multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL)
continue; continue;
namebuf[0] = NUL; namebuf[0] = NUL;
pattern[0] = NUL;
if (!multiscan) if (!multiscan)
errmsg[0] = NUL; errmsg[0] = NUL;
lnum = 0; lnum = 0;
@@ -522,6 +528,17 @@ restofline:
col = (int)atol((char *)regmatch.startp[i]); col = (int)atol((char *)regmatch.startp[i]);
use_viscol = TRUE; use_viscol = TRUE;
} }
if ((i = (int)fmt_ptr->addr[9]) > 0) /* %s */
{
len = (int)(regmatch.endp[i] - regmatch.startp[i]);
if (len > CMDBUFFSIZE - 5)
len = CMDBUFFSIZE - 5;
STRCPY(pattern, "^\\V");
STRNCAT(pattern, regmatch.startp[i], len);
pattern[len + 3] = '\\';
pattern[len + 4] = '$';
pattern[len + 5] = NUL;
}
break; break;
} }
} }
@@ -624,6 +641,7 @@ restofline:
lnum, lnum,
col, col,
use_viscol, use_viscol,
pattern,
enr, enr,
type, type,
valid) == FAIL) valid) == FAIL)
@@ -667,6 +685,7 @@ qf_init_ok:
qf_init_end: qf_init_end:
vim_free(namebuf); vim_free(namebuf);
vim_free(errmsg); vim_free(errmsg);
vim_free(pattern);
vim_free(fmtstr); vim_free(fmtstr);
#ifdef FEAT_WINDOWS #ifdef FEAT_WINDOWS
@@ -714,22 +733,23 @@ qf_new_list()
* Returns OK or FAIL. * Returns OK or FAIL.
*/ */
static int static int
qf_add_entry(prevp, dir, fname, mesg, lnum, col, vis_col, nr, type, valid) qf_add_entry(prevp, dir, fname, mesg, lnum, col, vis_col, pattern, nr, type,
struct qf_line **prevp; /* pointer to previously added entry or NULL */ valid)
qfline_T **prevp; /* pointer to previously added entry or NULL */
char_u *dir; /* optional directory name */ char_u *dir; /* optional directory name */
char_u *fname; /* file name or NULL */ char_u *fname; /* file name or NULL */
char_u *mesg; /* message */ char_u *mesg; /* message */
long lnum; /* line number */ long lnum; /* line number */
int col; /* column */ int col; /* column */
int vis_col; /* using visual column */ int vis_col; /* using visual column */
char_u *pattern; /* search pattern */
int nr; /* error number */ int nr; /* error number */
int type; /* type character */ int type; /* type character */
int valid; /* valid entry */ int valid; /* valid entry */
{ {
struct qf_line *qfp; qfline_T *qfp;
if ((qfp = (struct qf_line *)alloc((unsigned)sizeof(struct qf_line))) if ((qfp = (qfline_T *)alloc((unsigned)sizeof(qfline_T))) == NULL)
== NULL)
return FAIL; return FAIL;
qfp->qf_fnum = qf_get_fnum(dir, fname); qfp->qf_fnum = qf_get_fnum(dir, fname);
if ((qfp->qf_text = vim_strsave(mesg)) == NULL) if ((qfp->qf_text = vim_strsave(mesg)) == NULL)
@@ -740,6 +760,14 @@ qf_add_entry(prevp, dir, fname, mesg, lnum, col, vis_col, nr, type, valid)
qfp->qf_lnum = lnum; qfp->qf_lnum = lnum;
qfp->qf_col = col; qfp->qf_col = col;
qfp->qf_viscol = vis_col; qfp->qf_viscol = vis_col;
if (pattern == NULL || *pattern == NUL)
qfp->qf_pattern = NULL;
else if ((qfp->qf_pattern = vim_strsave(pattern)) == NULL)
{
vim_free(qfp->qf_text);
vim_free(qfp);
return FAIL;
}
qfp->qf_nr = nr; qfp->qf_nr = nr;
if (type != 1 && !vim_isprintc(type)) /* only printable chars allowed */ if (type != 1 && !vim_isprintc(type)) /* only printable chars allowed */
type = 0; type = 0;
@@ -1018,8 +1046,8 @@ qf_jump(dir, errornr, forceit)
int errornr; int errornr;
int forceit; int forceit;
{ {
struct qf_line *qf_ptr; qfline_T *qf_ptr;
struct qf_line *old_qf_ptr; qfline_T *old_qf_ptr;
int qf_index; int qf_index;
int old_qf_fnum; int old_qf_fnum;
int old_qf_index; int old_qf_index;
@@ -1272,6 +1300,8 @@ qf_jump(dir, errornr, forceit)
if (curbuf == old_curbuf) if (curbuf == old_curbuf)
setpcmark(); setpcmark();
if (qf_ptr->qf_pattern == NULL)
{
/* /*
* Go to line with error, unless qf_lnum is 0. * Go to line with error, unless qf_lnum is 0.
*/ */
@@ -1312,6 +1342,17 @@ qf_jump(dir, errornr, forceit)
} }
else else
beginline(BL_WHITE | BL_FIX); beginline(BL_WHITE | BL_FIX);
}
else
{
pos_T save_cursor;
/* Move the cursor to the first line in the buffer */
save_cursor = curwin->w_cursor;
curwin->w_cursor.lnum = 0;
if (!do_search(NULL, '/', qf_ptr->qf_pattern, (long)1, SEARCH_KEEP))
curwin->w_cursor = save_cursor;
}
#ifdef FEAT_FOLDING #ifdef FEAT_FOLDING
if ((fdo_flags & FDO_QUICKFIX) && old_KeyTyped) if ((fdo_flags & FDO_QUICKFIX) && old_KeyTyped)
@@ -1385,7 +1426,7 @@ qf_list(eap)
{ {
buf_T *buf; buf_T *buf;
char_u *fname; char_u *fname;
struct qf_line *qfp; qfline_T *qfp;
int i; int i;
int idx1 = 1; int idx1 = 1;
int idx2 = -1; int idx2 = -1;
@@ -1450,6 +1491,14 @@ qf_list(eap)
sprintf((char *)IObuff + STRLEN(IObuff), "%s:", sprintf((char *)IObuff + STRLEN(IObuff), "%s:",
(char *)qf_types(qfp->qf_type, qfp->qf_nr)); (char *)qf_types(qfp->qf_type, qfp->qf_nr));
msg_puts_attr(IObuff, hl_attr(HLF_N)); msg_puts_attr(IObuff, hl_attr(HLF_N));
if (qfp->qf_pattern != NULL)
{
qf_fmt_text(qfp->qf_pattern, IObuff, IOSIZE);
STRCAT(IObuff, ":");
msg_puts(IObuff);
}
msg_puts((char_u *)" ");
/* Remove newlines and leading whitespace from the text. /* Remove newlines and leading whitespace from the text.
* For an unrecognized line keep the indent, the compiler may * For an unrecognized line keep the indent, the compiler may
* mark a word with ^^^^. */ * mark a word with ^^^^. */
@@ -1571,12 +1620,13 @@ qf_msg()
qf_free(idx) qf_free(idx)
int idx; int idx;
{ {
struct qf_line *qfp; qfline_T *qfp;
while (qf_lists[idx].qf_count) while (qf_lists[idx].qf_count)
{ {
qfp = qf_lists[idx].qf_start->qf_next; qfp = qf_lists[idx].qf_start->qf_next;
vim_free(qf_lists[idx].qf_start->qf_text); vim_free(qf_lists[idx].qf_start->qf_text);
vim_free(qf_lists[idx].qf_start->qf_pattern);
vim_free(qf_lists[idx].qf_start); vim_free(qf_lists[idx].qf_start);
qf_lists[idx].qf_start = qfp; qf_lists[idx].qf_start = qfp;
--qf_lists[idx].qf_count; --qf_lists[idx].qf_count;
@@ -1594,7 +1644,7 @@ qf_mark_adjust(line1, line2, amount, amount_after)
long amount_after; long amount_after;
{ {
int i; int i;
struct qf_line *qfp; qfline_T *qfp;
int idx; int idx;
for (idx = 0; idx < qf_listcount; ++idx) for (idx = 0; idx < qf_listcount; ++idx)
@@ -1913,7 +1963,7 @@ qf_update_buffer()
qf_fill_buffer() qf_fill_buffer()
{ {
linenr_T lnum; linenr_T lnum;
struct qf_line *qfp; qfline_T *qfp;
buf_T *errbuf; buf_T *errbuf;
int len; int len;
int old_KeyTyped = KeyTyped; int old_KeyTyped = KeyTyped;
@@ -1958,6 +2008,11 @@ qf_fill_buffer()
(char *)qf_types(qfp->qf_type, qfp->qf_nr)); (char *)qf_types(qfp->qf_type, qfp->qf_nr));
len += (int)STRLEN(IObuff + len); len += (int)STRLEN(IObuff + len);
} }
else if (qfp->qf_pattern != NULL)
{
qf_fmt_text(qfp->qf_pattern, IObuff + len, IOSIZE - len);
len += (int)STRLEN(IObuff + len);
}
IObuff[len++] = '|'; IObuff[len++] = '|';
IObuff[len++] = ' '; IObuff[len++] = ' ';
@@ -2285,7 +2340,7 @@ ex_vimgrep(eap)
char_u *p; char_u *p;
int i; int i;
int fi; int fi;
struct qf_line *prevp = NULL; qfline_T *prevp = NULL;
long lnum; long lnum;
garray_T ga; garray_T ga;
buf_T *buf; buf_T *buf;
@@ -2434,6 +2489,7 @@ ex_vimgrep(eap)
regmatch.startpos[0].lnum + lnum, regmatch.startpos[0].lnum + lnum,
regmatch.startpos[0].col + 1, regmatch.startpos[0].col + 1,
FALSE, /* vis_col */ FALSE, /* vis_col */
NULL, /* search pattern */
0, /* nr */ 0, /* nr */
0, /* type */ 0, /* type */
TRUE /* valid */ TRUE /* valid */
@@ -2698,7 +2754,7 @@ get_errorlist(list)
{ {
dict_T *dict; dict_T *dict;
char_u buf[2]; char_u buf[2];
struct qf_line *qfp; qfline_T *qfp;
int i; int i;
if (qf_curlist >= qf_listcount || qf_lists[qf_curlist].qf_count == 0) if (qf_curlist >= qf_listcount || qf_lists[qf_curlist].qf_count == 0)
@@ -2722,6 +2778,7 @@ get_errorlist(list)
|| dict_add_nr_str(dict, "col", (long)qfp->qf_col, NULL) == FAIL || dict_add_nr_str(dict, "col", (long)qfp->qf_col, NULL) == FAIL
|| dict_add_nr_str(dict, "vcol", (long)qfp->qf_viscol, NULL) == FAIL || dict_add_nr_str(dict, "vcol", (long)qfp->qf_viscol, NULL) == FAIL
|| dict_add_nr_str(dict, "nr", (long)qfp->qf_nr, NULL) == FAIL || dict_add_nr_str(dict, "nr", (long)qfp->qf_nr, NULL) == FAIL
|| dict_add_nr_str(dict, "pattern", 0L, qfp->qf_pattern) == FAIL
|| dict_add_nr_str(dict, "text", 0L, qfp->qf_text) == FAIL || dict_add_nr_str(dict, "text", 0L, qfp->qf_text) == FAIL
|| dict_add_nr_str(dict, "type", 0L, buf) == FAIL || dict_add_nr_str(dict, "type", 0L, buf) == FAIL
|| dict_add_nr_str(dict, "valid", (long)qfp->qf_valid, NULL) == FAIL) || dict_add_nr_str(dict, "valid", (long)qfp->qf_valid, NULL) == FAIL)
@@ -2731,6 +2788,86 @@ get_errorlist(list)
} }
return OK; return OK;
} }
/*
* Populate the quickfix list with the items supplied in the list
* of dictionaries.
*/
int
set_errorlist(list)
list_T *list;
{
listitem_T *li;
dict_T *d;
char_u *filename, *pattern, *text, *type;
long lnum;
int col, nr;
int vcol;
qfline_T *prevp = NULL;
int valid, status;
int retval = OK;
/* make place for a new list */
qf_new_list();
for (li = list->lv_first; li != NULL; li = li->li_next)
{
if (li->li_tv.v_type != VAR_DICT)
continue; /* Skip non-dict items */
d = li->li_tv.vval.v_dict;
if (d == NULL)
continue;
filename = get_dict_string(d, (char_u *)"filename");
lnum = get_dict_number(d, (char_u *)"lnum");
col = get_dict_number(d, (char_u *)"col");
vcol = get_dict_number(d, (char_u *)"vcol");
nr = get_dict_number(d, (char_u *)"nr");
type = get_dict_string(d, (char_u *)"type");
pattern = get_dict_string(d, (char_u *)"pattern");
text = get_dict_string(d, (char_u *)"text");
if (text == NULL)
text = vim_strsave((char_u *)"");
valid = TRUE;
if (filename == NULL || (lnum == 0 && pattern == NULL))
valid = FALSE;
status = qf_add_entry(&prevp,
NULL, /* dir */
filename,
text,
lnum,
col,
vcol, /* vis_col */
pattern, /* search pattern */
nr,
type == NULL ? NUL : *type,
valid);
vim_free(filename);
vim_free(pattern);
vim_free(text);
vim_free(type);
if (status == FAIL)
{
retval = FAIL;
break;
}
}
qf_lists[qf_curlist].qf_nonevalid = FALSE;
qf_lists[qf_curlist].qf_ptr = qf_lists[qf_curlist].qf_start;
qf_lists[qf_curlist].qf_index = 1;
#ifdef FEAT_WINDOWS
qf_update_buffer();
#endif
return retval;
}
#endif #endif
/* /*
@@ -2779,7 +2916,7 @@ ex_helpgrep(eap)
char_u **fnames; char_u **fnames;
FILE *fd; FILE *fd;
int fi; int fi;
struct qf_line *prevp = NULL; qfline_T *prevp = NULL;
long lnum; long lnum;
#ifdef FEAT_MULTI_LANG #ifdef FEAT_MULTI_LANG
char_u *lang; char_u *lang;
@@ -2848,6 +2985,7 @@ ex_helpgrep(eap)
(int)(regmatch.startp[0] - IObuff) (int)(regmatch.startp[0] - IObuff)
+ 1, /* col */ + 1, /* col */
FALSE, /* vis_col */ FALSE, /* vis_col */
NULL, /* search pattern */
0, /* nr */ 0, /* nr */
1, /* type */ 1, /* type */
TRUE /* valid */ TRUE /* valid */

View File

@@ -2337,7 +2337,7 @@ fold_line(wp, fold_count, foldinfo, lnum, row)
else else
len = W_WIDTH(wp) - txtcol; len = W_WIDTH(wp) - txtcol;
RL_MEMSET(wp->w_old_cursor_fcol + txtcol, hl_attr(HLF_V), RL_MEMSET(wp->w_old_cursor_fcol + txtcol, hl_attr(HLF_V),
len - wp->w_old_cursor_fcol); len - (int)wp->w_old_cursor_fcol);
} }
} }
else else
@@ -3591,6 +3591,9 @@ win_line(wp, lnum, startrow, endrow)
* @Spell cluster. */ * @Spell cluster. */
if (has_spell && v >= word_end) if (has_spell && v >= word_end)
{ {
spell_attr = 0;
if (area_attr == 0 && search_attr == 0)
char_attr = syntax_attr;
if (!has_syntax || can_spell) if (!has_syntax || can_spell)
{ {
char_u *prev_ptr = ptr - ( char_u *prev_ptr = ptr - (
@@ -3599,7 +3602,6 @@ win_line(wp, lnum, startrow, endrow)
# endif # endif
1); 1);
spell_attr = 0;
iswordc = spell_iswordc(prev_ptr); iswordc = spell_iswordc(prev_ptr);
if (iswordc && !prev_iswordc) if (iswordc && !prev_iswordc)
{ {
@@ -3620,8 +3622,6 @@ win_line(wp, lnum, startrow, endrow)
} }
prev_iswordc = iswordc; prev_iswordc = iswordc;
} }
else
spell_attr = 0;
} }
if (spell_attr != 0) if (spell_attr != 0)
char_attr = hl_combine_attr(char_attr, spell_attr); char_attr = hl_combine_attr(char_attr, spell_attr);

View File

@@ -1030,13 +1030,15 @@ struct builtin_term builtin_termcaps[] =
{K_HOME, IF_EB("\033[1;*H", ESC_STR "[1;*H")}, {K_HOME, IF_EB("\033[1;*H", ESC_STR "[1;*H")},
/* {K_S_HOME, IF_EB("\033O2H", ESC_STR "O2H")}, */ /* {K_S_HOME, IF_EB("\033O2H", ESC_STR "O2H")}, */
/* {K_C_HOME, IF_EB("\033O5H", ESC_STR "O5H")}, */ /* {K_C_HOME, IF_EB("\033O5H", ESC_STR "O5H")}, */
{K_KHOME, IF_EB("\033[7;*~", ESC_STR "[7;*~")}, {K_KHOME, IF_EB("\033[1;*~", ESC_STR "[1;*~")},
{K_XHOME, IF_EB("\033O*H", ESC_STR "O*H")}, /* other Home */ {K_XHOME, IF_EB("\033O*H", ESC_STR "O*H")}, /* other Home */
{K_ZHOME, IF_EB("\033[7;*~", ESC_STR "[7;*~")}, /* other Home */
{K_END, IF_EB("\033[1;*F", ESC_STR "[1;*F")}, {K_END, IF_EB("\033[1;*F", ESC_STR "[1;*F")},
/* {K_S_END, IF_EB("\033O2F", ESC_STR "O2F")}, */ /* {K_S_END, IF_EB("\033O2F", ESC_STR "O2F")}, */
/* {K_C_END, IF_EB("\033O5F", ESC_STR "O5F")}, */ /* {K_C_END, IF_EB("\033O5F", ESC_STR "O5F")}, */
{K_KEND, IF_EB("\033[4;*~", ESC_STR "[4;*~")}, {K_KEND, IF_EB("\033[4;*~", ESC_STR "[4;*~")},
{K_XEND, IF_EB("\033O*F", ESC_STR "O*F")}, /* other End */ {K_XEND, IF_EB("\033O*F", ESC_STR "O*F")}, /* other End */
{K_ZEND, IF_EB("\033[8;*~", ESC_STR "[8;*~")},
{K_PAGEUP, IF_EB("\033[5;*~", ESC_STR "[5;*~")}, {K_PAGEUP, IF_EB("\033[5;*~", ESC_STR "[5;*~")},
{K_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")}, {K_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")},
{K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */ {K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
@@ -1340,11 +1342,13 @@ struct builtin_term builtin_termcaps[] =
{K_C_HOME, "[C-HOME]"}, {K_C_HOME, "[C-HOME]"},
{K_KHOME, "[KHOME]"}, {K_KHOME, "[KHOME]"},
{K_XHOME, "[XHOME]"}, {K_XHOME, "[XHOME]"},
{K_ZHOME, "[ZHOME]"},
{K_END, "[END]"}, {K_END, "[END]"},
{K_S_END, "[C-END]"}, {K_S_END, "[C-END]"},
{K_C_END, "[C-END]"}, {K_C_END, "[C-END]"},
{K_KEND, "[KEND]"}, {K_KEND, "[KEND]"},
{K_XEND, "[XEND]"}, {K_XEND, "[XEND]"},
{K_ZEND, "[ZEND]"},
{K_PAGEUP, "[PAGEUP]"}, {K_PAGEUP, "[PAGEUP]"},
{K_PAGEDOWN, "[PAGEDOWN]"}, {K_PAGEDOWN, "[PAGEDOWN]"},
{K_KPAGEUP, "[KPAGEUP]"}, {K_KPAGEUP, "[KPAGEUP]"},

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 22)" #define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 25)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 22, compiled " #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 25, compiled "