summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/eval.txt77
-rw-r--r--runtime/doc/tags3
-rw-r--r--runtime/doc/usr_41.txt7
-rw-r--r--runtime/ftplugin.vim10
-rw-r--r--runtime/lang/menu_ko_kr.utf-8.vim4
-rw-r--r--runtime/spell/en.spl3
-rw-r--r--runtime/syntax/mail.vim8
-rw-r--r--runtime/syntax/sh.vim6
-rw-r--r--runtime/syntax/vimspell.vim4
-rw-r--r--src/edit.c27
-rw-r--r--src/ex_getln.c35
-rw-r--r--src/globals.h4
-rw-r--r--src/keymap.h11
-rw-r--r--src/misc2.c6
-rw-r--r--src/proto/eval.pro2
-rw-r--r--src/quickfix.c312
-rw-r--r--src/screen.c8
-rw-r--r--src/term.c6
-rw-r--r--src/version.h4
19 files changed, 343 insertions, 194 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 8ff4bac067..dc2078662e 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -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
@@ -1452,7 +1452,6 @@ did_filetype() Number TRUE if FileType autocommand event used
diff_filler( {lnum}) Number diff filler lines about {lnum}
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
empty( {expr}) Number TRUE if {expr} is empty
-errorlist() List list of quickfix items
escape( {string}, {chars}) String escape {chars} in {string} with '\'
eval( {string}) any evaluate {string} into its value
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}
getline( {lnum}) String line {lnum} 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
getregtype( [{regname}]) String type of register
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}
setcmdpos( {pos}) Number set cursor position in command-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
setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
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
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 the characters in {chars} that occur in {string} with a
backslash. Example: >
@@ -2548,6 +2527,28 @@ getline({lnum} [, {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()*
The result is a String, which is the contents of register
{regname}. Example: >
@@ -3590,6 +3591,34 @@ setline({lnum}, {line}) *setline()*
:call setline(5, strftime("%c"))
< 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({regname}, {value} [,{options}])
Set the register {regname} to {value}.
diff --git a/runtime/doc/tags b/runtime/doc/tags
index a1b79f87d6..ecf5fcf42a 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -4689,7 +4689,6 @@ errorformat-javac quickfix.txt /*errorformat-javac*
errorformat-multi-line quickfix.txt /*errorformat-multi-line*
errorformat-separate-filename quickfix.txt /*errorformat-separate-filename*
errorformats quickfix.txt /*errorformats*
-errorlist() eval.txt /*errorlist()*
escape intro.txt /*escape*
escape() eval.txt /*escape()*
escape-bar version4.txt /*escape-bar*
@@ -4977,6 +4976,7 @@ getfsize() eval.txt /*getfsize()*
getftime() eval.txt /*getftime()*
getftype() eval.txt /*getftype()*
getline() eval.txt /*getline()*
+getqflist() eval.txt /*getqflist()*
getreg() eval.txt /*getreg()*
getregtype() eval.txt /*getregtype()*
getwinposx() eval.txt /*getwinposx()*
@@ -6175,6 +6175,7 @@ set-option options.txt /*set-option*
setbufvar() eval.txt /*setbufvar()*
setcmdpos() eval.txt /*setcmdpos()*
setline() eval.txt /*setline()*
+setqflist() eval.txt /*setqflist()*
setreg() eval.txt /*setreg()*
setting-guifont gui.txt /*setting-guifont*
setwinvar() eval.txt /*setwinvar()*
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 27349896fe..e765b336cc 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -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
@@ -723,7 +723,7 @@ Interactive:
input() get a line from the user
inputsecret() get a line from the user without showing it
inputdialog() get a line from the user in a dialog
- inputresave save and clear typeahead
+ inputsave() save and clear typeahead
inputrestore() restore typeahead
Vim server:
@@ -745,7 +745,7 @@ Various:
maparg() get rhs of a mapping
exists() check if a variable, function, etc. exists
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
did_filetype() check if a FileType autocommand was used
eventhandler() check if invoked by an event handler
@@ -757,6 +757,7 @@ Various:
libcallnr() idem, returning a number
getreg() get contents of a register
getregtype() get type of a register
+ setqflist() create a quickfix list
setreg() set contents and type of a register
taglist() get list of matching tags
diff --git a/runtime/ftplugin.vim b/runtime/ftplugin.vim
index d0813268d8..922656605a 100644
--- a/runtime/ftplugin.vim
+++ b/runtime/ftplugin.vim
@@ -1,7 +1,7 @@
" Vim support file to switch on loading plugins for file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2004 Nov 22
+" Last change: 2005 Mar 25
if exists("did_load_ftplugin")
finish
@@ -11,11 +11,11 @@ let did_load_ftplugin = 1
augroup filetypeplugin
au FileType * call s:LoadFTPlugin()
func! s:LoadFTPlugin()
+ if exists("b:undo_ftplugin")
+ exe b:undo_ftplugin
+ unlet! b:undo_ftplugin b:did_ftplugin
+ endif
if expand("<amatch>") != ""
- if exists("b:undo_ftplugin")
- exe b:undo_ftplugin
- unlet! b:undo_ftplugin b:did_ftplugin
- endif
if &cpo =~# "S" && exists("b:did_ftplugin")
" In compatible mode options are reset to the global values, need to
" set the local values also when a plugin was already used.
diff --git a/runtime/lang/menu_ko_kr.utf-8.vim b/runtime/lang/menu_ko_kr.utf-8.vim
index e08d9ba93f..8e507d5fb4 100644
--- a/runtime/lang/menu_ko_kr.utf-8.vim
+++ b/runtime/lang/menu_ko_kr.utf-8.vim
@@ -48,7 +48,7 @@ menutrans &Paste<Tab>"+gP 붙이기(&P)<Tab>"+gP
menutrans Put\ &Before<Tab>[p 앞에\ 붙이기(&B)<Tab>[p
menutrans Put\ &After<Tab>]p 뒤에\ 붙이기(&A)<Tab>]p
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\ and\ Rep&lace\.\.\. 찾아서\ 바꾸기(&l)\.\.\.
menutrans Settings\ &Window 설정\ 창(&W)
@@ -229,7 +229,7 @@ endif
" Syntax menu
menutrans &Syntax 문법(&S)
-menutrans &Show\ individual\ choices 모든\ 선택가능한\ 항목\ 보기(&S)
+menutrans &Show\ filetypes\ in\ menu 모든\ 선택가능한\ 항목\ 보기(&S)
menutrans Set\ '&syntax'\ only 'syntax'만\ 설정(&s)
menutrans Set\ '&filetype'\ too 'filetype'도\ 설정(&f)
menutrans &Off 끄기(&O)
diff --git a/runtime/spell/en.spl b/runtime/spell/en.spl
index 9279da1a4e..7ebdb0f256 100644
--- a/runtime/spell/en.spl
+++ b/runtime/spell/en.spl
@@ -1,6 +1,6 @@
# Language: English
# Maintainer: Charles E. Campbell, Jr. <charles.e.campbell.1@gsfc.nasa.gov>
-# Last Change: 2005 Mar 22
+# Last Change: 2005 Mar 23
a
aardvark
aardvarks
@@ -186689,6 +186689,7 @@ you're
you've
MS-Windows
MS-DOS
+Ltd.
# What may come after any word
+'s
diff --git a/runtime/syntax/mail.vim b/runtime/syntax/mail.vim
index eca30f449c..a45eb61ce6 100644
--- a/runtime/syntax/mail.vim
+++ b/runtime/syntax/mail.vim
@@ -2,7 +2,7 @@
" Language: Mail file
" Previous Maintainer: Felix von Leitner <leitner@math.fu-berlin.de>
" 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
if exists("b:current_syntax")
@@ -36,14 +36,14 @@ syn match mailHeaderKey contained "\v(^(\> ?)*)@<=date:"
syn match mailSubject contained "\v(^(\> ?)*)@<=subject:.*$"
" 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)
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.
-syn match mailURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-z0-9/]`
-syn match mailEmail "\v[_=a-z\./+0-9-]+\@[a-z0-9._-]+\a{2}"
+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}" contains=@NoSpell
" Make sure quote markers in regions (header / signature) have correct color
syn match mailQuoteExp1 contained "\v^(\> ?)"
diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index ac52ce2897..ab762738bd 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -2,8 +2,8 @@
" Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change: Mar 02, 2005
-" Version: 73
+" Last Change: Mar 24, 2005
+" Version: 74
" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
"
" 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 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 keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
if exists("b:is_bash")
diff --git a/runtime/syntax/vimspell.vim b/runtime/syntax/vimspell.vim
index 379fe31cc7..4c4149bdd2 100644
--- a/runtime/syntax/vimspell.vim
+++ b/runtime/syntax/vimspell.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Vim spell file
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2005 Mar 22
+" Last Change: 2005 Mar 24
" Quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -11,7 +11,7 @@ endif
syn match vimspellError ".*"
syn match vimspellRegion "^---$"
syn match vimspellRegion "^\(-\l\l\)\+$"
-syn match vimspellOK "^!\=[>+]\=[[:alpha:]]\S*"
+syn match vimspellOK "^!\=[>+]\=[[:alpha:]].*"
syn match vimspellOK "^!\=+\S*"
syn match vimspellError "\s\+$"
syn match vimspellOK "^$"
diff --git a/src/edit.c b/src/edit.c
index 39fc0ee0a3..30eece2962 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -244,7 +244,6 @@ edit(cmdchar, startln, count)
int lastc;
colnr_T mincol;
static linenr_T o_lnum = 0;
- static int o_eol = FALSE;
int i;
int did_backspace = TRUE; /* previous char was backspace */
#ifdef FEAT_CINDENT
@@ -426,7 +425,7 @@ edit(cmdchar, startln, count)
*/
validate_virtcol();
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)
&& *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL)
{
@@ -441,7 +440,7 @@ edit(cmdchar, startln, count)
}
#endif
}
- o_eol = FALSE;
+ ins_at_eol = FALSE;
}
else
arrow_used = FALSE;
@@ -713,11 +712,9 @@ edit(cmdchar, startln, count)
switch (c)
{
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_C_LEFT: c = K_C_RIGHT; 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_C_RIGHT: c = K_C_LEFT; break;
}
@@ -816,10 +813,10 @@ edit(cmdchar, startln, count)
restart_edit = 'I';
#ifdef FEAT_VIRTUALEDIT
if (virtual_active())
- o_eol = FALSE; /* cursor always keeps its column */
+ ins_at_eol = FALSE; /* cursor always keeps its column */
else
#endif
- o_eol = (gchar_cursor() == NUL);
+ ins_at_eol = (gchar_cursor() == NUL);
goto doESCkey;
#ifdef FEAT_SNIFF
@@ -888,7 +885,7 @@ doESCkey:
#endif
/* Always update o_lnum, so that a "CTRL-O ." that adds a line
* 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;
if (ins_esc(&count, cmdchar))
@@ -1098,7 +1095,6 @@ doESCkey:
case K_HOME:
case K_KHOME:
- case K_XHOME:
case K_S_HOME:
case K_C_HOME:
ins_home(c);
@@ -1106,14 +1102,12 @@ doESCkey:
case K_END:
case K_KEND:
- case K_XEND:
case K_S_END:
case K_C_END:
ins_end(c);
break;
case K_LEFT:
- case K_XLEFT:
if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL))
ins_s_left();
else
@@ -1126,7 +1120,6 @@ doESCkey:
break;
case K_RIGHT:
- case K_XRIGHT:
if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL))
ins_s_right();
else
@@ -1139,7 +1132,6 @@ doESCkey:
break;
case K_UP:
- case K_XUP:
if (mod_mask & MOD_MASK_SHIFT)
ins_pageup();
else
@@ -1153,7 +1145,6 @@ doESCkey:
break;
case K_DOWN:
- case K_XDOWN:
if (mod_mask & MOD_MASK_SHIFT)
ins_pagedown();
else
@@ -6243,14 +6234,12 @@ ins_ctrl_g()
{
/* CTRL-G k and CTRL-G <Up>: cursor up to Insstart.col */
case K_UP:
- case K_XUP:
case Ctrl_K:
case 'k': ins_up(TRUE);
break;
/* CTRL-G j and CTRL-G <Down>: cursor down to Insstart.col */
case K_DOWN:
- case K_XDOWN:
case Ctrl_J:
case 'j': ins_down(TRUE);
break;
@@ -6473,17 +6462,11 @@ ins_start_select(c)
switch (c)
{
case K_KHOME:
- case K_XHOME:
case K_KEND:
- case K_XEND:
case K_PAGEUP:
case K_KPAGEUP:
case K_PAGEDOWN:
case K_KPAGEDOWN:
- case K_XLEFT:
- case K_XRIGHT:
- case K_XUP:
- case K_XDOWN:
# ifdef MACOS
case K_LEFT:
case K_RIGHT:
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 53bff7588c..a71b68ef9c 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -326,11 +326,9 @@ getcmdline(firstc, count, indent)
switch (c)
{
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_C_RIGHT: c = K_C_LEFT; 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_C_LEFT: c = K_C_RIGHT; break;
}
@@ -363,10 +361,10 @@ getcmdline(firstc, count, indent)
* list */
if (lookfor != NULL
&& 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_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)))
{
vim_free(lookfor);
@@ -384,9 +382,9 @@ getcmdline(firstc, count, indent)
/* Special translations for 'wildmenu' */
if (did_wild_list && p_wmnu)
{
- if (c == K_LEFT || c == K_XLEFT)
+ if (c == K_LEFT)
c = Ctrl_P;
- else if (c == K_RIGHT || c == K_XRIGHT)
+ else if (c == K_RIGHT)
c = Ctrl_N;
}
/* Hitting CR after "emenu Name.": complete submenu */
@@ -407,8 +405,7 @@ getcmdline(firstc, count, indent)
(void)ExpandOne(&xpc, NULL, NULL, 0, WILD_FREE);
did_wild_list = FALSE;
#ifdef FEAT_WILDMENU
- if (!p_wmnu || (c != K_UP && c != K_DOWN
- && c != K_XUP && c != K_XDOWN))
+ if (!p_wmnu || (c != K_UP && c != K_DOWN))
#endif
xpc.xp_context = EXPAND_NOTHING;
wim_index = 0;
@@ -455,10 +452,9 @@ getcmdline(firstc, count, indent)
if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu)
{
/* Hitting <Down> after "emenu Name.": complete submenu */
- if (ccline.cmdbuff[ccline.cmdpos - 1] == '.'
- && (c == K_DOWN || c == K_XDOWN))
+ if (ccline.cmdbuff[ccline.cmdpos - 1] == '.' && c == K_DOWN)
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
* cursor */
@@ -505,15 +501,14 @@ getcmdline(firstc, count, indent)
upseg[4] = NUL;
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 - 3] != '.'))
{
/* go down a directory */
c = p_wc;
}
- else if (STRNCMP(xpc.xp_pattern, upseg + 1, 3) == 0
- && (c == K_DOWN || c == K_XDOWN))
+ else if (STRNCMP(xpc.xp_pattern, upseg + 1, 3) == 0 && c == K_DOWN)
{
/* If in a direct ancestor, strip off one ../ to go down */
int found = FALSE;
@@ -541,7 +536,7 @@ getcmdline(firstc, count, indent)
c = p_wc;
}
}
- else if (c == K_UP || c == K_XUP)
+ else if (c == K_UP)
{
/* go up a directory */
int found = FALSE;
@@ -1107,7 +1102,6 @@ getcmdline(firstc, count, indent)
continue; /* don't do incremental search now */
case K_RIGHT:
- case K_XRIGHT:
case K_S_RIGHT:
case K_C_RIGHT:
do
@@ -1136,7 +1130,6 @@ getcmdline(firstc, count, indent)
goto cmdline_not_changed;
case K_LEFT:
- case K_XLEFT:
case K_S_LEFT:
case K_C_LEFT:
do
@@ -1296,7 +1289,6 @@ getcmdline(firstc, count, indent)
case Ctrl_B: /* begin of command line */
case K_HOME:
case K_KHOME:
- case K_XHOME:
case K_S_HOME:
case K_C_HOME:
ccline.cmdpos = 0;
@@ -1306,7 +1298,6 @@ getcmdline(firstc, count, indent)
case Ctrl_E: /* end of command line */
case K_END:
case K_KEND:
- case K_XEND:
case K_S_END:
case K_C_END:
ccline.cmdpos = ccline.cmdlen;
@@ -1335,9 +1326,7 @@ getcmdline(firstc, count, indent)
#ifdef FEAT_CMDHIST
case K_UP:
- case K_XUP:
case K_DOWN:
- case K_XDOWN:
case K_S_UP:
case K_S_DOWN:
case K_PAGEUP:
@@ -1361,7 +1350,7 @@ getcmdline(firstc, count, indent)
for (;;)
{
/* 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)
{
if (hiscnt == hislen) /* first time */
@@ -1398,7 +1387,7 @@ getcmdline(firstc, count, indent)
hiscnt = i;
break;
}
- if ((c != K_UP && c != K_DOWN && c != K_XUP && c != K_XDOWN)
+ if ((c != K_UP && c != K_DOWN)
|| hiscnt == i
|| STRNCMP(history[histype][hiscnt].hisstr,
lookfor, (size_t)j) == 0)
diff --git a/src/globals.h b/src/globals.h
index af4eed0f3d..81c1f7ec79 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -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
- * 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 */
@@ -806,6 +806,8 @@ EXTERN int arrow_used; /* Normally FALSE, set to TRUE after
* hitting cursor key in insert mode.
* Used by vgetorpeek() to decide when
* 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
EXTERN char_u *edit_submode INIT(= NULL); /* msg for CTRL-X submode */
EXTERN char_u *edit_submode_pre INIT(= NULL); /* prepended to edit_submode */
diff --git a/src/keymap.h b/src/keymap.h
index 35bc9b3154..96e88044f6 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -206,7 +206,9 @@ enum key_extra
, KE_XF3
, KE_XF4
, 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_ZHOME /* extra (vt100) home key for xterm */
, KE_XUP /* extra vt100 cursor keys for xterm */
, KE_XDOWN
, KE_XLEFT
@@ -381,9 +383,11 @@ enum key_extra
#define K_HOME TERMCAP2KEY('k', 'h')
#define K_KHOME TERMCAP2KEY('K', '1') /* keypad home (upper left) */
#define K_XHOME TERMCAP2KEY(KS_EXTRA, KE_XHOME)
+#define K_ZHOME TERMCAP2KEY(KS_EXTRA, KE_ZHOME)
#define K_END TERMCAP2KEY('@', '7')
#define K_KEND TERMCAP2KEY('K', '4') /* keypad end (lower left) */
#define K_XEND TERMCAP2KEY(KS_EXTRA, KE_XEND)
+#define K_ZEND TERMCAP2KEY(KS_EXTRA, KE_ZEND)
#define K_PAGEUP TERMCAP2KEY('k', 'P')
#define K_PAGEDOWN TERMCAP2KEY('k', 'N')
#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_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_MENU TERMCAP2KEY(KS_MENU, KE_FILLER)
#define K_VER_SCROLLBAR TERMCAP2KEY(KS_VER_SCROLLBAR, KE_FILLER)
diff --git a/src/misc2.c b/src/misc2.c
index ebf3933e80..c8952074cd 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1843,9 +1843,11 @@ static struct key_name_entry
{K_HOME, (char_u *)"Home"},
{K_KHOME, (char_u *)"kHome"},
{K_XHOME, (char_u *)"xHome"},
+ {K_ZHOME, (char_u *)"zHome"},
{K_END, (char_u *)"End"},
{K_KEND, (char_u *)"kEnd"},
{K_XEND, (char_u *)"xEnd"},
+ {K_ZEND, (char_u *)"zEnd"},
{K_PAGEUP, (char_u *)"PageUp"},
{K_PAGEDOWN, (char_u *)"PageDown"},
{K_KPAGEUP, (char_u *)"kPageUp"},
@@ -1999,8 +2001,6 @@ simplify_key(key, modifiers)
/*
* 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
handle_x_keys(key)
@@ -2013,7 +2013,9 @@ handle_x_keys(key)
case K_XLEFT: return K_LEFT;
case K_XRIGHT: return K_RIGHT;
case K_XHOME: return K_HOME;
+ case K_ZHOME: return K_HOME;
case K_XEND: return K_END;
+ case K_ZEND: return K_END;
case K_XF1: return K_F1;
case K_XF2: return K_F2;
case K_XF3: return K_F3;
diff --git a/src/proto/eval.pro b/src/proto/eval.pro
index 023f422c18..13bd82af80 100644
--- a/src/proto/eval.pro
+++ b/src/proto/eval.pro
@@ -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));
dict_T *dict_alloc __ARGS((void));
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_expr_name __ARGS((expand_T *xp, int idx));
void set_vim_var_nr __ARGS((int idx, long val));
diff --git a/src/quickfix.c b/src/quickfix.c
index c34f47f791..a4c016e09a 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -24,22 +24,24 @@ struct dir_stack_T
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 */
- struct qf_line *qf_prev; /* pointer to previous error in the list */
- linenr_T qf_lnum; /* line number where the error occurred */
- int qf_fnum; /* file number for the line */
- int qf_col; /* column where the error occurred */
- int qf_nr; /* error number */
- char_u *qf_text; /* description of the error */
- 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_type; /* type of the error (mostly 'E'); 1 for
+ qfline_T *qf_next; /* pointer to next 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 */
+ int qf_fnum; /* file number for the line */
+ int qf_col; /* column where the error occurred */
+ 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_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_type; /* type of the error (mostly 'E'); 1 for
:helpgrep */
- char_u qf_valid; /* valid error message detected */
+ char_u qf_valid; /* valid error message detected */
};
/*
@@ -49,17 +51,17 @@ struct qf_line
struct qf_list
{
- struct qf_line *qf_start; /* pointer to the first error */
- struct qf_line *qf_ptr; /* pointer to the current error */
- int qf_count; /* number of errors (0 means no error list) */
- int qf_index; /* current index in the error list */
- int qf_nonevalid; /* TRUE if not a single valid entry found */
+ qfline_T *qf_start; /* pointer to the first error */
+ qfline_T *qf_ptr; /* pointer to the current error */
+ int qf_count; /* number of errors (0 means no error list) */
+ int qf_index; /* current index in the error list */
+ int qf_nonevalid; /* TRUE if not a single valid entry found */
} qf_lists[LISTCOUNT];
static int qf_curlist = 0; /* current error list */
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'
@@ -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 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_free __ARGS((int idx));
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 *errmsg;
+ char_u *pattern;
char_u *fmtstr = NULL;
int col = 0;
char_u use_viscol = FALSE;
@@ -154,7 +157,7 @@ qf_init_ext(efile, buf, errorformat, newlist, lnumfirst, lnumlast)
long lnum = 0L;
int enr = 0;
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;
struct eformat *fmt_first = NULL;
struct eformat *fmt_last = NULL;
@@ -189,12 +192,14 @@ qf_init_ext(efile, buf, errorformat, newlist, lnumfirst, lnumlast)
{'m', ".\\+"},
{'r', ".*"},
{'p', "[- .]*"},
- {'v', "\\d\\+"}
+ {'v', "\\d\\+"},
+ {'s', ".\\+"}
};
namebuf = 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;
if (efile != NULL && (fd = mch_fopen((char *)efile, "r")) == NULL)
@@ -463,6 +468,7 @@ restofline:<