summaryrefslogtreecommitdiff
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 8ff4bac06..dc2078662 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 a1b79f87d..ecf5fcf42 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 27349896f..e765b336c 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 d0813268d..922656605 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 e08d9ba93..8e507d5fb 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 9279da1a4..7ebdb0f25 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 eca30f449..a45eb61ce 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 ac52ce289..ab762738b 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 379fe31cc..4c4149bdd 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 39fc0ee0a..30eece296 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 53bff7588..a71b68ef9 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 af4eed0f3..81c1f7ec7 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 35bc9b315..96e88044f 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 ebf3933e8..c8952074c 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 023f422c1..13bd82af8 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 c34f47f79..a4c016e09 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:
if (multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL)
continue;
namebuf[0] = NUL;
+ pattern[0] = NUL;
if (!multiscan)
errmsg[0] = NUL;
lnum = 0;
@@ -522,6 +528,17 @@ restofline:
col = (int)atol((char *)regmatch.startp[i]);
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;
}
}
@@ -624,6 +641,7 @@ restofline:
lnum,
col,
use_viscol,
+ pattern,
enr,
type,
valid) == FAIL)
@@ -667,6 +685,7 @@ qf_init_ok:
qf_init_end:
vim_free(namebuf);
vim_free(errmsg);
+ vim_free(pattern);
vim_free(fmtstr);
#ifdef FEAT_WINDOWS
@@ -714,22 +733,23 @@ qf_new_list()
* Returns OK or FAIL.
*/
static int
-qf_add_entry(prevp, dir, fname, mesg, lnum, col, vis_col, nr, type, valid)
- struct qf_line **prevp; /* pointer to previously added entry or NULL */
+qf_add_entry(prevp, dir, fname, mesg, lnum, col, vis_col, pattern, nr, type,
+ valid)
+ qfline_T **prevp; /* pointer to previously added entry or NULL */
char_u *dir; /* optional directory name */
char_u *fname; /* file name or NULL */
char_u *mesg; /* message */
long lnum; /* line number */
int col; /* column */
int vis_col; /* using visual column */
+ char_u *pattern; /* search pattern */
int nr; /* error number */
int type; /* type character */
int valid; /* valid entry */
{
- struct qf_line *qfp;
+ qfline_T *qfp;
- if ((qfp = (struct qf_line *)alloc((unsigned)sizeof(struct qf_line)))
- == NULL)
+ if ((qfp = (qfline_T *)alloc((unsigned)sizeof(qfline_T))) == NULL)
return FAIL;
qfp->qf_fnum = qf_get_fnum(dir, fname);
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_col = 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;
if (type != 1 && !vim_isprintc(type)) /* only printable chars allowed */
type = 0;
@@ -1018,8 +1046,8 @@ qf_jump(dir, errornr, forceit)
int errornr;
int forceit;
{
- struct qf_line *qf_ptr;
- struct qf_line *old_qf_ptr;
+ qfline_T *qf_ptr;
+ qfline_T *old_qf_ptr;
int qf_index;
int old_qf_fnum;
int old_qf_index;
@@ -1272,46 +1300,59 @@ qf_jump(dir, errornr, forceit)
if (curbuf == old_curbuf)
setpcmark();
- /*
- * Go to line with error, unless qf_lnum is 0.
- */
- i = qf_ptr->qf_lnum;
- if (i > 0)
+ if (qf_ptr->qf_pattern == NULL)
{
- if (i > curbuf->b_ml.ml_line_count)
- i = curbuf->b_ml.ml_line_count;
- curwin->w_cursor.lnum = i;
- }
- if (qf_ptr->qf_col > 0)
- {
- curwin->w_cursor.col = qf_ptr->qf_col - 1;
- if (qf_ptr->qf_viscol == TRUE)
+ /*
+ * Go to line with error, unless qf_lnum is 0.
+ */
+ i = qf_ptr->qf_lnum;
+ if (i > 0)
{
- /*
- * Check each character from the beginning of the error
- * line up to the error column. For each tab character
- * found, reduce the error column value by the length of
- * a tab character.
- */
- line = ml_get_curline();
- screen_col = 0;
- for (char_col = 0; char_col < curwin->w_cursor.col; ++char_col)
+ if (i > curbuf->b_ml.ml_line_count)
+ i = curbuf->b_ml.ml_line_count;
+ curwin->w_cursor.lnum = i;
+ }
+ if (qf_ptr->qf_col > 0)
+ {
+ curwin->w_cursor.col = qf_ptr->qf_col - 1;
+ if (qf_ptr->qf_viscol == TRUE)
{
- if (*line == NUL)
- break;
- if (*line++ == '\t')
+ /*
+ * Check each character from the beginning of the error
+ * line up to the error column. For each tab character
+ * found, reduce the error column value by the length of
+ * a tab character.
+ */
+ line = ml_get_curline();
+ screen_col = 0;
+ for (char_col = 0; char_col < curwin->w_cursor.col; ++char_col)
{
- curwin->w_cursor.col -= 7 - (screen_col % 8);
- screen_col += 8 - (screen_col % 8);
+ if (*line == NUL)
+ break;
+ if (*line++ == '\t')
+ {
+ curwin->w_cursor.col -= 7 - (screen_col % 8);
+ screen_col += 8 - (screen_col % 8);
+ }
+ else
+ ++screen_col;
}
- else
- ++screen_col;
}
+ check_cursor();
}
- check_cursor();
+ else
+ beginline(BL_WHITE | BL_FIX);
}
else
- beginline(BL_WHITE | BL_FIX);
+ {
+ 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
if ((fdo_flags & FDO_QUICKFIX) && old_KeyTyped)
@@ -1383,16 +1424,16 @@ theend:
qf_list(eap)
exarg_T *eap;
{
- buf_T *buf;
- char_u *fname;
- struct qf_line *qfp;
- int i;
- int idx1 = 1;
- int idx2 = -1;
- int need_return = TRUE;
- int last_printed = 1;
- char_u *arg = eap->arg;
- int all = eap->forceit; /* if not :cl!, only show
+ buf_T *buf;
+ char_u *fname;
+ qfline_T *qfp;
+ int i;
+ int idx1 = 1;
+ int idx2 = -1;
+ int need_return = TRUE;
+ int last_printed = 1;
+ char_u *arg = eap->arg;
+ int all = eap->forceit; /* if not :cl!, only show
recognised errors */
if (qf_curlist >= qf_listcount || qf_lists[qf_curlist].qf_count == 0)
@@ -1447,9 +1488,17 @@ qf_list(eap)
else
sprintf((char *)IObuff, ":%ld col %d",
qfp->qf_lnum, qfp->qf_col);
- sprintf((char *)IObuff + STRLEN(IObuff), "%s: ",
+ sprintf((char *)IObuff + STRLEN(IObuff), "%s:",
(char *)qf_types(qfp->qf_type, qfp->qf_nr));
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.
* For an unrecognized line keep the indent, the compiler may
* mark a word with ^^^^. */
@@ -1571,12 +1620,13 @@ qf_msg()
qf_free(idx)
int idx;
{
- struct qf_line *qfp;
+ qfline_T *qfp;
while (qf_lists[idx].qf_count)
{
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_pattern);
vim_free(qf_lists[idx].qf_start);
qf_lists[idx].qf_start = qfp;
--qf_lists[idx].qf_count;
@@ -1593,9 +1643,9 @@ qf_mark_adjust(line1, line2, amount, amount_after)
long amount;
long amount_after;
{
- int i;
- struct qf_line *qfp;
- int idx;
+ int i;
+ qfline_T *qfp;
+ int idx;
for (idx = 0; idx < qf_listcount; ++idx)
if (qf_lists[idx].qf_count)
@@ -1912,11 +1962,11 @@ qf_update_buffer()
static void
qf_fill_buffer()
{
- linenr_T lnum;
- struct qf_line *qfp;
- buf_T *errbuf;
- int len;
- int old_KeyTyped = KeyTyped;
+ linenr_T lnum;
+ qfline_T *qfp;
+ buf_T *errbuf;
+ int len;
+ int old_KeyTyped = KeyTyped;
/* delete all existing lines */
while ((curbuf->b_ml.ml_flags & ML_EMPTY) == 0)
@@ -1958,6 +2008,11 @@ qf_fill_buffer()
(char *)qf_types(qfp->qf_type, qfp->qf_nr));
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++] = ' ';
@@ -2285,7 +2340,7 @@ ex_vimgrep(eap)
char_u *p;
int i;
int fi;
- struct qf_line *prevp = NULL;
+ qfline_T *prevp = NULL;
long lnum;
garray_T ga;
buf_T *buf;
@@ -2434,6 +2489,7 @@ ex_vimgrep(eap)
regmatch.startpos[0].lnum + lnum,
regmatch.startpos[0].col + 1,
FALSE, /* vis_col */
+ NULL, /* search pattern */
0, /* nr */
0, /* type */
TRUE /* valid */
@@ -2696,10 +2752,10 @@ unload_dummy_buffer(buf)
get_errorlist(list)
list_T *list;
{
- dict_T *dict;
- char_u buf[2];
- struct qf_line *qfp;
- int i;
+ dict_T *dict;
+ char_u buf[2];
+ qfline_T *qfp;
+ int i;
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, "vcol", (long)qfp->qf_viscol, 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, "type", 0L, buf) == FAIL
|| dict_add_nr_str(dict, "valid", (long)qfp->qf_valid, NULL) == FAIL)
@@ -2731,6 +2788,86 @@ get_errorlist(list)
}
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
/*
@@ -2779,7 +2916,7 @@ ex_helpgrep(eap)
char_u **fnames;
FILE *fd;
int fi;
- struct qf_line *prevp = NULL;
+ qfline_T *prevp = NULL;
long lnum;
#ifdef FEAT_MULTI_LANG
char_u *lang;
@@ -2848,6 +2985,7 @@ ex_helpgrep(eap)
(int)(regmatch.startp[0] - IObuff)
+ 1, /* col */
FALSE, /* vis_col */
+ NULL, /* search pattern */
0, /* nr */
1, /* type */
TRUE /* valid */
diff --git a/src/screen.c b/src/screen.c
index 28565fa42..70c7ff189 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2337,7 +2337,7 @@ fold_line(wp, fold_count, foldinfo, lnum, row)
else
len = W_WIDTH(wp) - txtcol;
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
@@ -3591,6 +3591,9 @@ win_line(wp, lnum, startrow, endrow)
* @Spell cluster. */
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)
{
char_u *prev_ptr = ptr - (
@@ -3599,7 +3602,6 @@ win_line(wp, lnum, startrow, endrow)
# endif
1);
- spell_attr = 0;
iswordc = spell_iswordc(prev_ptr);
if (iswordc && !prev_iswordc)
{
@@ -3620,8 +3622,6 @@ win_line(wp, lnum, startrow, endrow)
}
prev_iswordc = iswordc;
}
- else
- spell_attr = 0;
}
if (spell_attr != 0)
char_attr = hl_combine_attr(char_attr, spell_attr);
diff --git a/src/term.c b/src/term.c
index c4f2d9f8e..20203b5cf 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1030,13 +1030,15 @@ struct builtin_term builtin_termcaps[] =
{K_HOME, IF_EB("\033[1;*H", ESC_STR "[1;*H")},
/* {K_S_HOME, IF_EB("\033O2H", ESC_STR "O2H")}, */
/* {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_ZHOME, IF_EB("\033[7;*~", ESC_STR "[7;*~")}, /* other Home */
{K_END, IF_EB("\033[1;*F", ESC_STR "[1;*F")},
/* {K_S_END, IF_EB("\033O2F", ESC_STR "O2F")}, */
/* {K_C_END, IF_EB("\033O5F", ESC_STR "O5F")}, */
{K_KEND, IF_EB("\033[4;*~", ESC_STR "[4;*~")},
{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_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")},
{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_KHOME, "[KHOME]"},
{K_XHOME, "[XHOME]"},
+ {K_ZHOME, "[ZHOME]"},
{K_END, "[END]"},
{K_S_END, "[C-END]"},
{K_C_END, "[C-END]"},
{K_KEND, "[KEND]"},
{K_XEND, "[XEND]"},
+ {K_ZEND, "[ZEND]"},
{K_PAGEUP, "[PAGEUP]"},
{K_PAGEDOWN, "[PAGEDOWN]"},
{K_KPAGEUP, "[KPAGEUP]"},
diff --git a/src/version.h b/src/version.h
index 2f2da8bab..8ecdf38eb 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 22)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 22, compiled "
+#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 25, compiled "