Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2016-08-16 17:13:33 -07:00
70 changed files with 3856 additions and 696 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ Common combination are:
- Using a job connected through pipes in NL mode. E.g., to run a style
checker and receive errors and warnings.
- Using a deamon, connecting over a socket in JSON mode. E.g. to lookup
crosss-refrences in a database.
cross-references in a database.
==============================================================================
2. Channel demo *channel-demo* *demoserver.py*
+7 -5
View File
@@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.4. Last change: 2016 Mar 28
*editing.txt* For Vim version 7.4. Last change: 2016 Aug 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1114,10 +1114,12 @@ The names can be in upper- or lowercase.
edited. See |:confirm| and 'confirm'. {not in Vi}
:q[uit]! Quit without writing, also when the current buffer has
changes. If this is the last window and there is a
modified hidden buffer, the current buffer is
abandoned and the first changed hidden buffer becomes
the current buffer.
changes. The buffer is unloaded, also when it has
'hidden' set.
If this is the last window and there is a modified
hidden buffer, the current buffer is abandoned and the
first changed hidden buffer becomes the current
buffer.
Use ":qall!" to exit always.
:cq[uit] Quit always, without writing, and return an error
+339 -168
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,4 +1,4 @@
*index.txt* For Vim version 7.4. Last change: 2016 Jul 16
*index.txt* For Vim version 7.4. Last change: 2016 Aug 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1207,7 +1207,7 @@ tag command action ~
|:display| :di[splay] display registers
|:djump| :dj[ump] jump to #define
|:dl| :dl short for |:delete| with the 'l' flag
|:dl| :del[ete]l short for |:delete| with the 'l' flag
|:del| :del[ete]l short for |:delete| with the 'l' flag
|:dlist| :dli[st] list #defines
|:doautocmd| :do[autocmd] apply autocommands to current buffer
|:doautoall| :doautoa[ll] apply autocommands for all loaded buffers
+34 -23
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4. Last change: 2016 Jul 29
*options.txt* For Vim version 7.4. Last change: 2016 Aug 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -261,10 +261,10 @@ global value, which is used for new buffers. With ":set" both the local and
global value is changed. With "setlocal" only the local value is changed,
thus this value is not used when editing a new buffer.
When editing a buffer that has been edited before, the last used window
options are used again. If this buffer has been edited in this window, the
values from back then are used. Otherwise the values from the window where
the buffer was edited last are used.
When editing a buffer that has been edited before, the options from the window
that was last closed are used again. If this buffer has been edited in this
window, the values from back then are used. Otherwise the values from the
last closed window where the buffer was edited last are used.
It's possible to set a local window option specifically for a type of buffer.
When you edit another buffer in the same window, you don't want to keep
@@ -3751,7 +3751,7 @@ A jump table for the options with a short description can be found at |Q_op|.
qXX - quality XX. Valid quality names are: PROOF, DRAFT,
ANTIALIASED, NONANTIALIASED, CLEARTYPE, DEFAULT.
Normally you would use "qDEFAULT".
Some quality values isn't supported in legacy OSs.
Some quality values are not supported in legacy OSs.
Use a ':' to separate the options.
- A '_' can be used in the place of a space, so you don't need to use
@@ -4058,17 +4058,16 @@ A jump table for the options with a short description can be found at |Q_op|.
*'highlight'* *'hl'*
'highlight' 'hl' string (default (as a single string):
"8:SpecialKey,@:NonText,d:Directory,
e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,
M:ModeMsg,n:LineNr,N:CursorLineNr,
r:Question,s:StatusLine,S:StatusLineNC,
c:VertSplit, t:Title,v:Visual,
w:WarningMsg,W:WildMenu,
f:Folded,F:FoldColumn,A:DiffAdd,
C:DiffChange,D:DiffDelete,T:DiffText,
>:SignColumn,B:SpellBad,P:SpellCap,
R:SpellRare,L:SpellLocal,-:Conceal,
+:Pmenu,=:PmenuSel,
"8:SpecialKey,~:EndOfBuffer,@:NonText,
d:Directory,e:ErrorMsg,i:IncSearch,
l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,
N:CursorLineNr,r:Question,s:StatusLine,
S:StatusLineNC,c:VertSplit,t:Title,
v:Visual,w:WarningMsg,W:WildMenu,f:Folded,
F:FoldColumn,A:DiffAdd,C:DiffChange,
D:DiffDelete,T:DiffText,>:SignColumn,
B:SpellBad,P:SpellCap,R:SpellRare,
L:SpellLocal,-:Conceal,+:Pmenu,=:PmenuSel,
x:PmenuSbar,X:PmenuThumb")
global
{not in Vi}
@@ -4077,7 +4076,8 @@ A jump table for the options with a short description can be found at |Q_op|.
first character in a pair gives the occasion, the second the mode to
use for that occasion. The occasions are:
|hl-SpecialKey| 8 Meta and special keys listed with ":map"
|hl-NonText| @ '~' and '@' at the end of the window and
|hl-EndOfBuffer| ~ lines after the last line in the buffer
|hl-NonText| @ '@' at the end of the window and
characters from 'showbreak'
|hl-Directory| d directories in CTRL-D listing and other special
things in listings
@@ -4517,7 +4517,7 @@ A jump table for the options with a short description can be found at |Q_op|.
if you want to use Vim as a modeless editor. Used for |evim|.
These Insert mode commands will be useful:
- Use the cursor keys to move around.
- Use CTRL-O to execute one Normal mode command |i_CTRL-O|). When
- Use CTRL-O to execute one Normal mode command |i_CTRL-O|. When
this is a mapping, it is executed as if 'insertmode' was off.
Normal mode remains active until the mapping is finished.
- Use CTRL-L to execute a number of Normal mode commands, then use
@@ -4865,7 +4865,7 @@ A jump table for the options with a short description can be found at |Q_op|.
use this command to get the tallest window possible: >
:set lines=999
< Minimum value is 2, maximum value is 1000.
If you get less lines than expected, check the 'guiheadroom' option.
If you get fewer lines than expected, check the 'guiheadroom' option.
When you set this option and Vim is unable to change the physical
number of lines of the display, the display may be messed up.
@@ -6873,10 +6873,21 @@ A jump table for the options with a short description can be found at |Q_op|.
Example: Try this together with 'sidescroll' and 'listchars' as
in the following example to never allow the cursor to move
onto the "extends" character:
onto the "extends" character: >
:set nowrap sidescroll=1 listchars=extends:>,precedes:<
:set sidescrolloff=1
<
*'signcolumn'* *'scl'*
'signcolumn' 'scl' string (default "auto")
local to window
{not in Vi}
{not available when compiled without the |+signs|
feature}
Whether or not to draw the signcolumn. Valid values are:
"auto" only when there is a sign to display
"no" never
"yes" always
*'smartcase'* *'scs'* *'nosmartcase'* *'noscs'*
@@ -8079,8 +8090,8 @@ A jump table for the options with a short description can be found at |Q_op|.
"xterm", "xterm2", "urxvt" or "sgr" (because dec mouse codes conflict
with them).
This option is automatically set to "xterm", when the 'term' option is
set to a name that starts with "xterm", "mlterm", or "screen", and
'ttymouse' is not set already.
set to a name that starts with "xterm", "mlterm", "screen", "st" (full
match only), "st-" or "stterm", and 'ttymouse' is not set already.
Additionally, if vim is compiled with the |+termresponse| feature and
|t_RV| is set to the escape sequence to request the xterm version
number, more intelligent detection process runs.
+2 -1
View File
@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 7.4. Last change: 2016 Jun 14
*quickref.txt* For Vim version 7.4. Last change: 2016 Aug 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -888,6 +888,7 @@ Short explanation of each option: *option-list*
'showtabline' 'stal' tells when the tab pages line is displayed
'sidescroll' 'ss' minimum number of columns to scroll horizontal
'sidescrolloff' 'siso' min. nr. of columns to left and right of cursor
'signcolumn' 'scl' when to display the sign column
'smartcase' 'scs' no ignore case when pattern has uppercase
'smartindent' 'si' smart autoindenting for C programs
'smarttab' 'sta' use 'shiftwidth' when inserting <Tab>
+5 -3
View File
@@ -1,4 +1,4 @@
*sign.txt* For Vim version 7.4. Last change: 2014 May 07
*sign.txt* For Vim version 7.4. Last change: 2016 Aug 12
VIM REFERENCE MANUAL by Gordon Prieur
@@ -45,8 +45,10 @@ There are two steps in using signs:
When signs are defined for a file, Vim will automatically add a column of two
characters to display them in. When the last sign is unplaced the column
disappears again. The color of the column is set with the SignColumn group
|hl-SignColumn|. Example to set the color: >
disappears again. This behavior can be changed with the 'signcolumn' option.
The color of the column is set with the SignColumn group |hl-SignColumn|.
Example to set the color: >
:highlight SignColumn guibg=darkgrey
+11 -6
View File
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.4. Last change: 2016 May 28
*syntax.txt* For Vim version 7.4. Last change: 2016 Aug 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -949,6 +949,8 @@ Variable Highlight ~
*c_no_bracket_error* don't highlight {}; inside [] as errors
*c_no_curly_error* don't highlight {}; inside [] and () as errors;
except { and } in first column
Default is to highlight them, otherwise you
can't spot a missing ")".
*c_curly_error* highlight a missing }; this forces syncing from the
start of the file, can be slow
*c_no_ansi* don't do standard ANSI types and constants
@@ -3762,7 +3764,7 @@ Whether or not it is actually concealed depends on the value of the
'conceallevel' option. The 'concealcursor' option is used to decide whether
concealable items in the current line are displayed unconcealed to be able to
edit the line.
Another way to conceal text with with |matchadd()|.
Another way to conceal text is with |matchadd()|.
concealends *:syn-concealends*
@@ -4868,6 +4870,9 @@ DiffChange diff mode: Changed line |diff.txt|
DiffDelete diff mode: Deleted line |diff.txt|
*hl-DiffText*
DiffText diff mode: Changed text within a changed line |diff.txt|
*hl-EndOfBuffer*
EndOfBuffer filler lines (~) after the last line in the buffer.
By default, this is highlighted like |hl-NonText|.
*hl-ErrorMsg*
ErrorMsg error messages on the command line
*hl-VertSplit*
@@ -4896,10 +4901,10 @@ ModeMsg 'showmode' message (e.g., "-- INSERT --")
*hl-MoreMsg*
MoreMsg |more-prompt|
*hl-NonText*
NonText '~' and '@' at the end of the window, characters from
'showbreak' and other characters that do not really exist in
the text (e.g., ">" displayed when a double-wide character
doesn't fit at the end of the line).
NonText '@' at the end of the window, characters from 'showbreak'
and other characters that do not really exist in the text
(e.g., ">" displayed when a double-wide character doesn't
fit at the end of the line).
*hl-Normal*
Normal normal text
*hl-Pmenu*
+24 -10
View File
@@ -820,6 +820,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'sbr' options.txt /*'sbr'*
'sc' options.txt /*'sc'*
'scb' options.txt /*'scb'*
'scl' options.txt /*'scl'*
'scr' options.txt /*'scr'*
'scroll' options.txt /*'scroll'*
'scrollbind' options.txt /*'scrollbind'*
@@ -862,6 +863,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'si' options.txt /*'si'*
'sidescroll' options.txt /*'sidescroll'*
'sidescrolloff' options.txt /*'sidescrolloff'*
'signcolumn' options.txt /*'signcolumn'*
'siso' options.txt /*'siso'*
'sj' options.txt /*'sj'*
'slm' options.txt /*'slm'*
@@ -6450,6 +6452,7 @@ gdb debug.txt /*gdb*
ge motion.txt /*ge*
get() eval.txt /*get()*
get-ms-debuggers debug.txt /*get-ms-debuggers*
getbufinfo() eval.txt /*getbufinfo()*
getbufline() eval.txt /*getbufline()*
getbufvar() eval.txt /*getbufvar()*
getchar() eval.txt /*getchar()*
@@ -6482,8 +6485,10 @@ getscript-data pi_getscript.txt /*getscript-data*
getscript-history pi_getscript.txt /*getscript-history*
getscript-plugins pi_getscript.txt /*getscript-plugins*
getscript-start pi_getscript.txt /*getscript-start*
gettabinfo() eval.txt /*gettabinfo()*
gettabvar() eval.txt /*gettabvar()*
gettabwinvar() eval.txt /*gettabwinvar()*
getwininfo() eval.txt /*getwininfo()*
getwinposx() eval.txt /*getwinposx()*
getwinposy() eval.txt /*getwinposy()*
getwinvar() eval.txt /*getwinvar()*
@@ -6692,6 +6697,7 @@ hl-DiffChange syntax.txt /*hl-DiffChange*
hl-DiffDelete syntax.txt /*hl-DiffDelete*
hl-DiffText syntax.txt /*hl-DiffText*
hl-Directory syntax.txt /*hl-Directory*
hl-EndOfBuffer syntax.txt /*hl-EndOfBuffer*
hl-ErrorMsg syntax.txt /*hl-ErrorMsg*
hl-FoldColumn syntax.txt /*hl-FoldColumn*
hl-Folded syntax.txt /*hl-Folded*
@@ -7679,6 +7685,7 @@ new-search-path version6.txt /*new-search-path*
new-searchpat version6.txt /*new-searchpat*
new-session-files version5.txt /*new-session-files*
new-spell version7.txt /*new-spell*
new-style-testing eval.txt /*new-style-testing*
new-tab-pages version7.txt /*new-tab-pages*
new-undo-branches version7.txt /*new-undo-branches*
new-unlisted-buffers version6.txt /*new-unlisted-buffers*
@@ -7723,6 +7730,7 @@ octal eval.txt /*octal*
octal-nrformats options.txt /*octal-nrformats*
octal-number eval.txt /*octal-number*
odbeditor gui_mac.txt /*odbeditor*
old-style-testing eval.txt /*old-style-testing*
oldfiles-variable eval.txt /*oldfiles-variable*
ole-activation if_ole.txt /*ole-activation*
ole-eval if_ole.txt /*ole-eval*
@@ -8535,11 +8543,11 @@ t_ZH term.txt /*t_ZH*
t_ZR term.txt /*t_ZR*
t_al term.txt /*t_al*
t_bc term.txt /*t_bc*
t_bool-varialble eval.txt /*t_bool-varialble*
t_bool-variable eval.txt /*t_bool-variable*
t_cd term.txt /*t_cd*
t_cdl version4.txt /*t_cdl*
t_ce term.txt /*t_ce*
t_channel-varialble eval.txt /*t_channel-varialble*
t_channel-variable eval.txt /*t_channel-variable*
t_ci version4.txt /*t_ci*
t_cil version4.txt /*t_cil*
t_cl term.txt /*t_cl*
@@ -8551,7 +8559,7 @@ t_cv version4.txt /*t_cv*
t_cvv version4.txt /*t_cvv*
t_da term.txt /*t_da*
t_db term.txt /*t_db*
t_dict-varialble eval.txt /*t_dict-varialble*
t_dict-variable eval.txt /*t_dict-variable*
t_dl term.txt /*t_dl*
t_ed version4.txt /*t_ed*
t_el version4.txt /*t_el*
@@ -8565,12 +8573,12 @@ t_f6 version4.txt /*t_f6*
t_f7 version4.txt /*t_f7*
t_f8 version4.txt /*t_f8*
t_f9 version4.txt /*t_f9*
t_float-varialble eval.txt /*t_float-varialble*
t_float-variable eval.txt /*t_float-variable*
t_fs term.txt /*t_fs*
t_func-varialble eval.txt /*t_func-varialble*
t_func-variable eval.txt /*t_func-variable*
t_help version4.txt /*t_help*
t_il version4.txt /*t_il*
t_job-varialble eval.txt /*t_job-varialble*
t_job-variable eval.txt /*t_job-variable*
t_k1 term.txt /*t_k1*
t_k2 term.txt /*t_k2*
t_k3 term.txt /*t_k3*
@@ -8595,15 +8603,15 @@ t_kr term.txt /*t_kr*
t_ks term.txt /*t_ks*
t_ku term.txt /*t_ku*
t_le term.txt /*t_le*
t_list-varialble eval.txt /*t_list-varialble*
t_list-variable eval.txt /*t_list-variable*
t_mb term.txt /*t_mb*
t_md term.txt /*t_md*
t_me term.txt /*t_me*
t_mr term.txt /*t_mr*
t_ms term.txt /*t_ms*
t_nd term.txt /*t_nd*
t_none-varialble eval.txt /*t_none-varialble*
t_number-varialble eval.txt /*t_number-varialble*
t_none-variable eval.txt /*t_none-variable*
t_number-variable eval.txt /*t_number-variable*
t_op term.txt /*t_op*
t_se term.txt /*t_se*
t_sf1 version4.txt /*t_sf1*
@@ -8623,7 +8631,7 @@ t_sku version4.txt /*t_sku*
t_so term.txt /*t_so*
t_sr term.txt /*t_sr*
t_star7 term.txt /*t_star7*
t_string-varialble eval.txt /*t_string-varialble*
t_string-variable eval.txt /*t_string-variable*
t_tb version4.txt /*t_tb*
t_te term.txt /*t_te*
t_ti term.txt /*t_ti*
@@ -8767,6 +8775,7 @@ test_null_list() eval.txt /*test_null_list()*
test_null_partial() eval.txt /*test_null_partial()*
test_null_string() eval.txt /*test_null_string()*
test_settime() eval.txt /*test_settime()*
testing eval.txt /*testing*
testing-variable eval.txt /*testing-variable*
tex-cchar syntax.txt /*tex-cchar*
tex-cole syntax.txt /*tex-cole*
@@ -8797,9 +8806,14 @@ throw-from-catch eval.txt /*throw-from-catch*
throw-variables eval.txt /*throw-variables*
throwpoint-variable eval.txt /*throwpoint-variable*
time-functions usr_41.txt /*time-functions*
timer eval.txt /*timer*
timer-functions usr_41.txt /*timer-functions*
timer_info() eval.txt /*timer_info()*
timer_pause() eval.txt /*timer_pause()*
timer_start() eval.txt /*timer_start()*
timer_stop() eval.txt /*timer_stop()*
timer_stopall() eval.txt /*timer_stopall()*
timers eval.txt /*timers*
timestamp editing.txt /*timestamp*
timestamps editing.txt /*timestamps*
tips tips.txt /*tips*
+25 -62
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4. Last change: 2016 Aug 02
*todo.txt* For Vim version 7.4. Last change: 2016 Aug 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,8 +34,6 @@ not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Should free_all_functions(void) skip numbered and lambda functions?
+channel:
- Channel test fails with Motif. Sometimes kills the X11 server.
- When a message in the queue but there is no callback, drop it after a while?
@@ -107,9 +105,6 @@ What if there is an invalid character?
Should json_encode()/json_decode() restrict recursiveness?
Or avoid recursiveness.
Patch to test popupmenu. Fails, possibly due to a bug.
(Christian Brabandt, 2016 Jul 23)
Once .exe with updated installer is available: Add remark to download page
about /S and /D options (Ken Takata, 2016 Apr 13)
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
@@ -138,53 +133,18 @@ Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807)
Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18)
Do we need some way (option) to show the sign column even when there are no
signs? Patch by Christian Brabandt, 2016 Jul 29.
Patch to allow setting w:quickfix_title via setqflist() and setloclist()
functions. (Christian Brabandt, 2013 May 8, update May 21)
Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
Second one. Update May 22.
Update by Daniel Hahler, 2014 Jul 4, Aug 14, Oct 14, Oct 15.
Updated patch: add an argument to setqflist() and getqflist() for these
extra items: Yegappan, 2016 Jul 30.
Patch to detect st terminal supporting xterm mouse. (Manuel Schiller, 2016 Aug
2, #963)
Syntax highlighting for messages with RFC3339 timestamp (#946)
Did maintainer reply?
Patch to add filtering of the quickfix list. (Yegappan Lakshmanan, 2016 Mar
13, last version) Update June 26, #830.
Instead use a Vim script implementation, invoked from a Vim command.
ml_get errors when reloading file. (Chris Desjardins, 2016 Apr 19)
Also with latest version.
Still problems with 'emoji'. See issue #721. Patch 7.4.1697 half-fixes it.
Avoid PLAN_WRITE in windgoto() ?
Should already never use utf-8 chars to position the cursor.
Cannot delete a file with square brackets with delete(). (#696)
No autocommand for when changing directory. Patch from allen haim, 2016 Jun
27, #888
Justin M Keyes: use "global" or "window" for the pattern. Can add "tab"
later. What if entering a window where ":lcd" was used?
Completion for input() does not expand environment variables. (chdiza, 2016
Jul 25, #948)
Patch to have text objects defined by arbitrary single characters. (Daniel
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
Ben Fritz: problem with 'selection' set to "exclusive".
Updated to current Vim, not quite right yet. (Ben Fritz, 2014 Mar 27)
Updated to current Vim (James McCoy, 2016 Jul 30, #958)
Still a bit of work left.
Patch to add CTRL-N / CTRL-P while searching. (Christian Brabandt, 2016 Jul
29)
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
's$^$\=capture("s/^//gn")' locks Vim in sandbox mode (#950)
Patch by Christian Brabandt, 2016 Jul 27.
@@ -198,6 +158,8 @@ Also for ":@.".
Patch to make printf() convert to string for %s items. (Ken Takata, 2016 Aug
1)
Patch to add %b to printf(). (Ozaki Kiichi, 2016 Aug 5)
Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925)
Patch on issue #728 by Christian Brabandt, 2016 Apr 7. Update with test: Apr 8.
@@ -206,6 +168,9 @@ Might be related to:
Test 44 fails when [[=A=]] is changed to [[=À=]]. Caused by getcmdline() not
handling the 0x80 as a second byte correctly? (Dominique Pelle, 2015 Jun 10)
Second problem in #966: ins_compl_add_tv() uses get_dict_string() multiple
times, overwrites the one buffer. (Nikolay Pavlov, 2016 Aug 5)
Patch to add 'topbot' to 'belloff' option. (Coot, 2016 Mar 18, #695)
Patch for C syntax HL. (Bradley Garagan, 2016 Apr 17) #763
@@ -213,6 +178,10 @@ Patch for C syntax HL. (Bradley Garagan, 2016 Apr 17) #763
Patch to make matchit work better, respect 'matchpairs'. (Ken Takata, 2016 Mar
25)
Patch to fix that on suckless Terminal mousewheel up does not work.
(Ralph Eastwood, 2013 Nov 25)
Patch for mouse support on suckless Terminal. #971 Manuel Schiller
This does not work: :set cscopequickfix=a-
(Linewi, 2015 Jul 12, #914)
@@ -245,9 +214,6 @@ Update from Ken Takata, 2016 Jul 17.
Patch to improve cscope. (Adrian Kocis, #843)
Patch to add getbufinfo(), gettabinfo() and getwininfo(). (Yegappan
Lakshmanan, 2016 Apr 2016) Update Jul 29. #833.
Patch for groovy multi-line comment highlighting. (Justin M. Keyes, 2016 May
20 #644)
@@ -265,7 +231,7 @@ No test, needs some work to include.
Patch to improve indenting for C++ constructor with initializer list.
(Hirohito Higashi, 2016 Mar 31)
After 7.5 is released:
After 8.0 is released:
- Drop support for older MS-Windows systems, before XP.
Patch from Ken Takata, 2016 Mar 8.
@@ -320,6 +286,16 @@ Should use /usr/local/share/applications or /usr/share/applications.
Or use $XDG_DATA_DIRS.
Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4)
Patch to test popupmenu. Fails, possibly due to a bug.
(Christian Brabandt, 2016 Jul 23)
Patch to have text objects defined by arbitrary single characters. (Daniel
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
Added tests (James McCoy, 2016 Aug 3). Still needs more work.
Patch to add CTRL-N / CTRL-P while searching. (Christian Brabandt, 2016 Aug
3) Problem: two matches in one line and using CTRL-P does not move back.
Access to uninitialized memory in match_backref() regexp_nda.c:4882
(Dominique Pelle, 2015 Nov 6)
@@ -540,7 +516,7 @@ Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1)
Patch for drag&drop reordering of GUI tab pages reordering.
(Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
Now on Git: https://gist.github.com/nocd5/165286495c782b815b94
Update 2016 Mar 15.
Update 2016 Aug 10.
Patch on Issue 72: 'autochdir' causes problems for :vimgrep.
@@ -560,9 +536,6 @@ any one-character from the previous line. (Kartik Agaram, 2014 Sep 19)
Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
Patch to add the EndOfBuffer highlight group, used instead of NonText for "~"
lines. (Marco Hinz, 2014 Nov 2)
Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19)
Should be easy to highlight all matches with 'incsearch'. Idea by Itchyny,
@@ -646,8 +619,7 @@ xterm should be able to pass focus changes to Vim, so that Vim can check for
buffers that changed. Perhaps in misc.c, function selectwindow().
Xterm 224 supports it!
Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki
Saito, 2013 Apr 24) Has a problem (email 2015 Jan 7).
Update 2015 Jan 10.
Saito, 2013 Apr 24) Update 2016 Aug 12.
Also see issue #609.
We could add the enable/disable sequences to t_ti/t_te or t_ks/t_ke.
@@ -776,9 +748,6 @@ Patch by Thomas Tuegel, also for GTK, 2013 Nov 24
Patch to add funcref to Lua. (Luis Carvalho, 2013 Sep 4)
With tests: Sep 5.
Patch to fix that on suckless Terminal mousewheel up does not work.
(Ralph Eastwood, 2013 Nov 25)
Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10)
Checking runtime scripts: Thilo Six, 2012 Jun 6.
@@ -871,9 +840,6 @@ Improve the installer for MS-Windows. There are a few alternatives:
Problem: they all work slightly different (e.g. don't install vimrun.exe).
How to test that it works well for all Vim users?
Patch to check whether a buffer is quickfix or a location list.
(Yasuhiro Matsumoto, 2014 Dec 9)
Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
Issue 54: document behavior of -complete, also expands arg.
@@ -1383,7 +1349,7 @@ https://scan.coverity.com/projects/241
Patch to support :undo absolute jump to file save number. (Christian Brabandt,
2010 Nov 5)
Patch to use 'foldnextmax' also for "marker" foldmethod. (Arnaud Lacombe, 2011
Patch to use 'foldnestmax' also for "marker" foldmethod. (Arnaud Lacombe, 2011
Jan 7)
Bug with 'incsearch' going to wrong line. (Wolfram Kresse, 2009 Aug 17)
@@ -2452,9 +2418,6 @@ Awaiting updated patches:
done for filetype detection. Patch from Walter Briscoe, 2003 Jul 1.
7 Add a "-@ filelist" argument: read file names from a file. (David
Kotchan has a patch for it)
8 Include a connection to an external program through a pipe? See
patches from Felbinger for a mathematica interface.
Or use emacs server kind of thing?
7 Add ":justify" command. Patch from Vit Stradal 2002 Nov 25.
- findmatch() should be adjusted for Lisp. See remark at
get_lisp_indent(). Esp. \( and \) should be skipped. (Dorai Sitaram,
+7 -1
View File
@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 7.4. Last change: 2016 Jul 24
*usr_41.txt* For Vim version 7.4. Last change: 2016 Aug 07
VIM USER MANUAL - by Bram Moolenaar
@@ -803,6 +803,9 @@ Buffers, windows and the argument list:
win_gotoid() go to window with ID
win_id2tabwin() get tab and window nr from window ID
win_id2win() get window nr from window ID
getbufinfo() get a list with buffer information
gettabinfo() get a list with tab page information
getwininfo() get a list with window information
Command line: *command-line-functions*
getcmdline() get the current command line
@@ -957,7 +960,10 @@ Jobs: *job-functions*
Timers: *timer-functions*
timer_start() create a timer
timer_pause() pause or unpause a timer
timer_stop() stop a timer
timer_stopall() stop all timers
timer_info() get information about timers
Various: *various-functions*
mode() get current editing mode
+1 -1
View File
@@ -4028,7 +4028,7 @@ Solution: Check for NULL pointer returned from mch_open().
Files: src/if_cscope.c
Patch 7.0.154
Problem: When 'foldnextmax' is negative Vim can hang. (James Vega)
Problem: When 'foldnestmax' is negative Vim can hang. (James Vega)
Solution: Avoid the fold level becoming negative.
Files: src/fold.c, src/syntax.c
+1720 -48
View File
File diff suppressed because it is too large Load Diff
+14 -2
View File
@@ -1,4 +1,4 @@
*vi_diff.txt* For Vim version 7.4. Last change: 2016 Feb 12
*vi_diff.txt* For Vim version 7.4. Last change: 2016 Aug 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -147,7 +147,7 @@ Support for different systems.
resource usage, esp. on MS-DOS. For some outdated systems you need to
use an older Vim version.
Multi level undo. |undo|
Multi level persistent undo. |undo|
'u' goes backward in time, 'CTRL-R' goes forward again. Set option
'undolevels' to the number of changes to be remembered (default 1000).
Set 'undolevels' to 0 for a Vi-compatible one level undo. Set it to
@@ -158,6 +158,9 @@ Multi level undo. |undo|
create a branch in the undo tree. This means you can go back to any
state of the text, there is no risk of a change causing text to be
lost forever. |undo-tree|
The undo information is stored in a file when the 'undofile' option is
set. This means you can exit Vim, start Vim on a previously edited
file and undo changes that were made before exiting Vim.
Graphical User Interface (GUI). |gui|
Included support for GUI: menu's, mouse, scrollbars, etc. You can
@@ -212,6 +215,15 @@ Plugins. |add-plugin|
right directory. That's an easy way to start using Vim scripts
written by others. Plugins can be for all kind of files, or
specifically for a filetype.
Packages make this even easier. |packages|
Asynchronous communication and timers. |channel| |job| |timer|
Vim can exchange messages with other processes in the background.
This makes it possible to have servers do work and send back the
results to Vim. |channel|
Vim can start a job, communicate with it and stop it. |job|
Timers can fire once or repeatedly and invoke a function to do any
work. |timer|
Repeat a series of commands. |q|
"q{c}" starts recording typed characters into named register {c}.
+184 -10
View File
@@ -1,18 +1,192 @@
" Vim indent file
" Language: Javascript
" Maintainer: Going to be Darrick Wiebe
" Last Change: 2015 Jun 09
" Language: Javascript
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
" Last Change: August 12, 2016
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
if exists('b:did_indent')
finish
endif
let b:did_indent = 1
" C indenting is not too bad.
setlocal cindent
" Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJavascriptIndent()
setlocal nolisp
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e
setlocal cinoptions+=j1,J1
setlocal cinkeys-=0#
setlocal cinkeys+=0]
let b:undo_indent = "setl cin<"
let b:undo_indent = 'setlocal indentexpr< indentkeys< cinoptions<'
" Only define the function once.
if exists('*GetJavascriptIndent')
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" Get shiftwidth value
if exists('*shiftwidth')
function s:sw()
return shiftwidth()
endfunction
else
function s:sw()
return &sw
endfunction
endif
let s:line_pre = '^\s*\%(\/\*.\{-}\*\/\s*\)*'
let s:expr_case = s:line_pre . '\%(\%(case\>.\+\)\|default\)\s*:'
" Regex of syntax group names that are or delimit string or are comments.
let s:syng_strcom = '\%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)'
" Regex of syntax group names that are strings or documentation.
let s:syng_comment = '\%(comment\|doc\)'
" Expression used to check whether we should skip a match with searchpair().
let s:skip_expr = "line('.') < (prevnonblank(v:lnum) - 2000) ? dummy : synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
function s:lookForParens(start,end,flags,time)
if has('reltime')
return searchpair(a:start,'',a:end,a:flags,s:skip_expr,0,a:time)
else
return searchpair(a:start,'',a:end,a:flags,0,0)
endif
endfunction
let s:line_term = '\%(\s*\%(\/\*.\{-}\*\/\s*\)\=\)\@>$'
" configurable regexes that define continuation lines, not including (, {, or [.
if !exists('g:javascript_opfirst')
let g:javascript_opfirst = '\%([<>,:?^%]\|\([-/.+]\)\%(\1\|\*\|\/\)\@!\|\*\/\@!\|=>\@!\||\|&\|in\%(stanceof\)\=\>\)'
endif
let g:javascript_opfirst = s:line_pre . g:javascript_opfirst
if !exists('g:javascript_continuation')
let g:javascript_continuation = '\%([<*,.?:^%]\|+\@<!+\|-\@<!-\|=\@<!>\|\*\@<!\/\|=\||\|&\|\<in\%(stanceof\)\=\)'
endif
let g:javascript_continuation .= s:line_term
function s:Onescope(lnum,text,add)
return a:text =~# '\%(\<else\|\<do\|=>' . (a:add ? '\|\<try\|\<finally' : '' ) . '\)' . s:line_term ||
\ ((a:add && a:text =~ s:line_pre . '$' && search('\%' . s:PrevCodeLine(a:lnum - 1) . 'l.)' . s:line_term)) ||
\ cursor(a:lnum, match(a:text, ')' . s:line_term)) > -1) &&
\ s:lookForParens('(', ')', 'cbW', 100) > 0 && search((a:add ?
\ '\%(function\*\|[[:lower:][:upper:]_$][[:digit:][:lower:][:upper:]_$]*\)' :
\ '\<\%(for\%(\s\+each\)\=\|if\|let\|w\%(hile\|ith\)\)') . '\_s*\%#\C','bW') &&
\ (a:add || (expand('<cword>') ==# 'while' ? !s:lookForParens('\<do\>\C', '\<while\>\C','bW',100) : 1))
endfunction
" Auxiliary Functions {{{2
" strip line of comment
function s:StripLine(c)
return a:c !~# s:expr_case ? substitute(a:c, '\%(:\@<!\/\/.*\)$', '','') : a:c
endfunction
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
function s:PrevCodeLine(lnum)
let l:lnum = prevnonblank(a:lnum)
while l:lnum > 0
if synIDattr(synID(l:lnum,matchend(getline(l:lnum), '^\s*[^''"]'),0),'name') !~? s:syng_strcom
break
endif
let l:lnum = prevnonblank(l:lnum - 1)
endwhile
return l:lnum
endfunction
" Check if line 'lnum' has a balanced amount of parentheses.
function s:Balanced(lnum)
let open_0 = 0
let open_2 = 0
let open_4 = 0
let l:line = getline(a:lnum)
let pos = match(l:line, '[][(){}]', 0)
while pos != -1
if synIDattr(synID(a:lnum,pos + 1,0),'name') !~? s:syng_strcom
let idx = stridx('(){}[]', l:line[pos])
if idx % 2 == 0
let open_{idx} = open_{idx} + 1
else
let open_{idx - 1} = open_{idx - 1} - 1
endif
endif
let pos = match(l:line, '[][(){}]', pos + 1)
endwhile
return (!open_4 + !open_2 + !open_0) - 2
endfunction
" }}}
function GetJavascriptIndent()
if !exists('b:js_cache')
let b:js_cache = [0,0,0]
endif
" Get the current line.
let l:line = getline(v:lnum)
let syns = synIDattr(synID(v:lnum, 1, 0), 'name')
" start with strings,comments,etc.{{{2
if (l:line !~ '^[''"`]' && syns =~? 'string\|template') ||
\ (l:line !~ '^\s*[/*]' && syns =~? s:syng_comment)
return -1
endif
if l:line !~ '^\%(\/\*\|\s*\/\/\)' && syns =~? s:syng_comment
return cindent(v:lnum)
endif
let l:lnum = s:PrevCodeLine(v:lnum - 1)
if l:lnum == 0
return 0
endif
if (l:line =~# s:expr_case)
let cpo_switch = &cpo
set cpo+=%
let ind = cindent(v:lnum)
let &cpo = cpo_switch
return ind
endif
"}}}
" the containing paren, bracket, curly. Memoize, last lineNr either has the
" same scope or starts a new one, unless if it closed a scope.
call cursor(v:lnum,1)
if b:js_cache[0] >= l:lnum && b:js_cache[0] <= v:lnum && b:js_cache[0] &&
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum) > 0)
let num = b:js_cache[1]
elseif syns != '' && l:line[0] =~ '\s'
let pattern = syns =~? 'block' ? ['{','}'] : syns =~? 'jsparen' ? ['(',')'] :
\ syns =~? 'jsbracket'? ['\[','\]'] : ['[({[]','[])}]']
let num = s:lookForParens(pattern[0],pattern[1],'bW',2000)
else
let num = s:lookForParens('[({[]','[])}]','bW',2000)
endif
let b:js_cache = [v:lnum,num,line('.') == v:lnum ? b:js_cache[2] : col('.')]
if l:line =~ s:line_pre . '[])}]'
return indent(num)
endif
let pline = s:StripLine(getline(l:lnum))
let inb = num == 0 ? 1 : (s:Onescope(num, s:StripLine(strpart(getline(num),0,b:js_cache[2] - 1)),1) ||
\ (l:line !~ s:line_pre . ',' && pline !~ ',' . s:line_term)) && num < l:lnum
let switch_offset = (!inb || num == 0) || expand("<cword>") !=# 'switch' ? 0 : &cino !~ ':' || !has('float') ? s:sw() :
\ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (&cino =~# '.*:[^,]*s' ? s:sw() : 1))
" most significant, find the indent amount
if (inb && (l:line =~# g:javascript_opfirst ||
\ (pline =~# g:javascript_continuation && pline !~# s:expr_case && (pline !~ ':' . s:line_term || l:line !~#
\ s:line_pre . '\%(d\%(o\|ebugger\)\|else\|f\%(or\|inally\)\|if\|let\|switch\|t\%(hrow\|ry\)\|w\%(hile\|ith\)\)\>')))) ||
\ (num < l:lnum && s:Onescope(l:lnum,pline,0) && l:line !~ s:line_pre . '{')
return (num > 0 ? indent(num) : -s:sw()) + (s:sw() * 2) + switch_offset
elseif num > 0
return indent(num) + s:sw() + switch_offset
endif
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
+30 -5
View File
@@ -37,7 +37,7 @@ function s:FindPrevLessIndentedLine(lnum, ...)
let curindent = a:0 ? a:1 : indent(a:lnum)
while prevlnum
\&& indent(prevlnum) >= curindent
\&& getline(prevlnum) !~# '^\s*#'
\&& getline(prevlnum) =~# '^\s*#'
let prevlnum = prevnonblank(prevlnum-1)
endwhile
return prevlnum
@@ -51,11 +51,33 @@ function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex)
return plilnum
endfunction
let s:mapkeyregex='\v^\s*%(\''%([^'']|'''')*\'''.
\ '|\"%([^"\\]|\\.)*\"'.
\ '|%(%(\:\ )@!.)*)\:%(\ |$)'
let s:mapkeyregex='\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\'''.
\ '|\"%([^"\\]|\\.)*\"'.
\ '|%(%(\:\ )@!.)*)\:%(\ |$)'
let s:liststartregex='\v^\s*%(\-%(\ |$))'
let s:c_ns_anchor_char = '\v%([\n\r\uFEFF \t,[\]{}]@!\p)'
let s:c_ns_anchor_name = s:c_ns_anchor_char.'+'
let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name
let s:ns_word_char = '\v[[:alnum:]_\-]'
let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])'
let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!'
let s:c_secondary_tag_handle = '\v\!\!'
let s:c_primary_tag_handle = '\v\!'
let s:c_tag_handle = '\v%('.s:c_named_tag_handle.
\ '|'.s:c_secondary_tag_handle.
\ '|'.s:c_primary_tag_handle.')'
let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+'
let s:c_non_specific_tag = '\v\!'
let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])'
let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>'
let s:c_ns_tag_property = '\v'.s:c_verbatim_tag.
\ '\v|'.s:c_ns_shorthand_tag.
\ '\v|'.s:c_non_specific_tag
let s:block_scalar_header = '\v[|>]%([+-]?[1-9]|[1-9]?[+-])?'
function GetYAMLIndent(lnum)
if a:lnum == 1 || !prevnonblank(a:lnum-1)
return 0
@@ -127,7 +149,10 @@ function GetYAMLIndent(lnum)
" - List with
" multiline scalar
return previndent+2
elseif prevline =~# s:mapkeyregex
elseif prevline =~# s:mapkeyregex . '\v\s*%(%('.s:c_ns_tag_property.
\ '\v|'.s:c_ns_anchor_property.
\ '\v|'.s:block_scalar_header.
\ '\v)%(\s+|\s*%(\#.*)?$))*'
" Mapping with: value
" that is multiline scalar
return previndent+s:shiftwidth()
+6 -1
View File
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2016 Apr 30
" Last Change: 2016 Aug 12
" If there already is an option window, jump to that one.
if bufwinnr("option-window") > 0
@@ -1322,6 +1322,11 @@ call append("$", "\t(local to buffer)")
call <SID>BinOptionL("bl")
call append("$", "debug\tset to \"msg\" to see all error messages")
call append("$", " \tset debug=" . &debug)
if has("signs")
call append("$", "signcolumn\twhether to show the signcolumn")
call append("$", "\t(local to window)")
call <SID>OptionL("scl")
endif
if has("mzscheme")
call append("$", "mzquantum\tinterval in milliseconds between polls for MzScheme threads")
call append("$", " \tset mzq=" . &mzq)
+4 -4
View File
@@ -1,7 +1,7 @@
" dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer: Honza Pokorny <http://honza.ca>
" Version: 0.5
" Last Change: 2014 Aug 29
" Maintainer: Honza Pokorny <https://honza.ca>
" Version: 0.6
" Last Change: 2016 Aug 9
" License: BSD
@@ -13,7 +13,7 @@ let b:current_syntax = "dockerfile"
syntax case ignore
syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|VOLUME|WORKDIR|COPY)\s/
syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)\s/
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
+4 -2
View File
@@ -4,8 +4,9 @@
" Maintainer: Dominik Fischer <d dot f dot fischer at web dot de>
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
" Contributor: Karsten Hopp <karsten@redhat.com>
" Last Change: 2016 Apr 7
" SSH Version: 7.2p2
" Contributor: Dean, Adam Kenneth <adam.ken.dean@hpe.com>
" Last Change: 2016 Aug 11
" SSH Version: 7.3p1
"
" Setup
@@ -205,6 +206,7 @@ syn keyword sshconfigKeyword Port
syn keyword sshconfigKeyword PreferredAuthentications
syn keyword sshconfigKeyword Protocol
syn keyword sshconfigKeyword ProxyCommand
syn keyword sshconfigKeyword ProxyJump
syn keyword sshconfigKeyword ProxyUseFDPass
syn keyword sshconfigKeyword PubkeyAcceptedKeyTypes
syn keyword sshconfigKeyword PubkeyAuthentication
+2 -1
View File
@@ -2045,7 +2045,6 @@ test1 \
test_listchars \
test_listlbr \
test_listlbr_utf8 \
test_mapping \
test_marks \
test_nested_function \
test_search_mbyte \
@@ -2073,6 +2072,7 @@ test_arglist \
test_autochdir \
test_autocmd \
test_backspace_opt \
test_bufwintabinfo \
test_cdo \
test_channel \
test_cmdline \
@@ -2110,6 +2110,7 @@ test_arglist \
test_largefile \
test_lispwords \
test_man \
test_mapping \
test_match \
test_matchadd_conceal \
test_matchadd_conceal_utf8 \
+1 -1
View File
@@ -6049,7 +6049,7 @@ __:
eof
eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
rm -f -- "${tmp_mkf}"
if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \
"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
vi_cv_path_python_plibs="-framework Python"
if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
+2 -2
View File
@@ -475,7 +475,7 @@ close_buffer(
if (win != NULL
#ifdef FEAT_WINDOWS
&& win_valid(win) /* in case autocommands closed the window */
&& win_valid_any_tab(win) /* in case autocommands closed the window */
#endif
)
{
@@ -581,7 +581,7 @@ aucmd_abort:
if (
#ifdef FEAT_WINDOWS
win_valid(win) &&
win_valid_any_tab(win) &&
#else
win != NULL &&
#endif
+1 -1
View File
@@ -1223,7 +1223,7 @@ eof
dnl -- delete the lines from make about Entering/Leaving directory
eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
rm -f -- "${tmp_mkf}"
if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \
"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
vi_cv_path_python_plibs="-framework Python"
if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
+24
View File
@@ -366,6 +366,30 @@ dict_add_list(dict_T *d, char *key, list_T *list)
return OK;
}
/*
* Add a dict entry to dictionary "d".
* Returns FAIL when out of memory and when key already exists.
*/
int
dict_add_dict(dict_T *d, char *key, dict_T *dict)
{
dictitem_T *item;
item = dictitem_alloc((char_u *)key);
if (item == NULL)
return FAIL;
item->di_tv.v_lock = 0;
item->di_tv.v_type = VAR_DICT;
item->di_tv.vval.v_dict = dict;
if (dict_add(d, item) == FAIL)
{
dictitem_free(item);
return FAIL;
}
++dict->dv_refcount;
return OK;
}
/*
* Get the number of items in a Dictionary.
*/
+1 -5
View File
@@ -6775,11 +6775,7 @@ comp_textwidth(
textwidth -= curwin->w_p_fdc;
#endif
#ifdef FEAT_SIGNS
if (curwin->w_buffer->b_signlist != NULL
# ifdef FEAT_NETBEANS_INTG
|| curwin->w_buffer->b_has_sign_column
# endif
)
if (signcolumn_on(curwin))
textwidth -= 1;
#endif
if (curwin->w_p_nu || curwin->w_p_rnu)
+6 -3
View File
@@ -233,8 +233,6 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate);
static int get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate);
static int free_unref_items(int copyID);
static int get_env_tv(char_u **arg, typval_T *rettv, int evaluate);
static int get_env_len(char_u **arg);
static char_u * make_expanded_name(char_u *in_start, char_u *expr_start, char_u *expr_end, char_u *in_end);
static void check_vars(char_u *name, int len);
@@ -4926,7 +4924,7 @@ get_string_tv(char_u **arg, typval_T *rettv, int evaluate)
break;
/* Special key, e.g.: "\<C-W>" */
case '<': extra = trans_special(&p, name, TRUE);
case '<': extra = trans_special(&p, name, TRUE, TRUE);
if (extra != 0)
{
name += extra;
@@ -4943,6 +4941,11 @@ get_string_tv(char_u **arg, typval_T *rettv, int evaluate)
}
*name = NUL;
if (p == NUL)
{
EMSG2(_("E114: Missing quote: %s"), *arg);
return FAIL;
}
*arg = p + 1;
return OK;
+403 -27
View File
@@ -152,6 +152,7 @@ static void f_funcref(typval_T *argvars, typval_T *rettv);
static void f_function(typval_T *argvars, typval_T *rettv);
static void f_garbagecollect(typval_T *argvars, typval_T *rettv);
static void f_get(typval_T *argvars, typval_T *rettv);
static void f_getbufinfo(typval_T *argvars, typval_T *rettv);
static void f_getbufline(typval_T *argvars, typval_T *rettv);
static void f_getbufvar(typval_T *argvars, typval_T *rettv);
static void f_getchar(typval_T *argvars, typval_T *rettv);
@@ -171,6 +172,7 @@ static void f_getfsize(typval_T *argvars, typval_T *rettv);
static void f_getftime(typval_T *argvars, typval_T *rettv);
static void f_getftype(typval_T *argvars, typval_T *rettv);
static void f_getline(typval_T *argvars, typval_T *rettv);
static void f_getloclist(typval_T *argvars UNUSED, typval_T *rettv UNUSED);
static void f_getmatches(typval_T *argvars, typval_T *rettv);
static void f_getpid(typval_T *argvars, typval_T *rettv);
static void f_getcurpos(typval_T *argvars, typval_T *rettv);
@@ -178,8 +180,10 @@ static void f_getpos(typval_T *argvars, typval_T *rettv);
static void f_getqflist(typval_T *argvars, typval_T *rettv);
static void f_getreg(typval_T *argvars, typval_T *rettv);
static void f_getregtype(typval_T *argvars, typval_T *rettv);
static void f_gettabinfo(typval_T *argvars, typval_T *rettv);
static void f_gettabvar(typval_T *argvars, typval_T *rettv);
static void f_gettabwinvar(typval_T *argvars, typval_T *rettv);
static void f_getwininfo(typval_T *argvars, typval_T *rettv);
static void f_getwinposx(typval_T *argvars, typval_T *rettv);
static void f_getwinposy(typval_T *argvars, typval_T *rettv);
static void f_getwinvar(typval_T *argvars, typval_T *rettv);
@@ -571,6 +575,7 @@ static struct fst
{"function", 1, 3, f_function},
{"garbagecollect", 0, 1, f_garbagecollect},
{"get", 2, 3, f_get},
{"getbufinfo", 0, 1, f_getbufinfo},
{"getbufline", 2, 3, f_getbufline},
{"getbufvar", 2, 3, f_getbufvar},
{"getchar", 0, 1, f_getchar},
@@ -581,7 +586,7 @@ static struct fst
{"getcmdtype", 0, 0, f_getcmdtype},
{"getcmdwintype", 0, 0, f_getcmdwintype},
#if defined(FEAT_CMDL_COMPL)
{"getcompletion", 2, 2, f_getcompletion},
{"getcompletion", 2, 3, f_getcompletion},
#endif
{"getcurpos", 0, 0, f_getcurpos},
{"getcwd", 0, 2, f_getcwd},
@@ -591,15 +596,17 @@ static struct fst
{"getftime", 1, 1, f_getftime},
{"getftype", 1, 1, f_getftype},
{"getline", 1, 2, f_getline},
{"getloclist", 1, 1, f_getqflist},
{"getloclist", 1, 2, f_getloclist},
{"getmatches", 0, 0, f_getmatches},
{"getpid", 0, 0, f_getpid},
{"getpos", 1, 1, f_getpos},
{"getqflist", 0, 0, f_getqflist},
{"getqflist", 0, 1, f_getqflist},
{"getreg", 0, 3, f_getreg},
{"getregtype", 0, 1, f_getregtype},
{"gettabinfo", 0, 1, f_gettabinfo},
{"gettabvar", 2, 3, f_gettabvar},
{"gettabwinvar", 3, 4, f_gettabwinvar},
{"getwininfo", 0, 1, f_getwininfo},
{"getwinposx", 0, 0, f_getwinposx},
{"getwinposy", 0, 0, f_getwinposy},
{"getwinvar", 2, 3, f_getwinvar},
@@ -741,10 +748,10 @@ static struct fst
{"setcmdpos", 1, 1, f_setcmdpos},
{"setfperm", 2, 2, f_setfperm},
{"setline", 2, 2, f_setline},
{"setloclist", 2, 3, f_setloclist},
{"setloclist", 2, 4, f_setloclist},
{"setmatches", 1, 1, f_setmatches},
{"setpos", 2, 2, f_setpos},
{"setqflist", 1, 2, f_setqflist},
{"setqflist", 1, 3, f_setqflist},
{"setreg", 2, 3, f_setreg},
{"settabvar", 3, 3, f_settabvar},
{"settabwinvar", 4, 4, f_settabwinvar},
@@ -3881,6 +3888,161 @@ f_get(typval_T *argvars, typval_T *rettv)
copy_tv(tv, rettv);
}
#ifdef FEAT_SIGNS
/*
* Returns information about signs placed in a buffer as list of dicts.
*/
static void
get_buffer_signs(buf_T *buf, list_T *l)
{
signlist_T *sign;
for (sign = buf->b_signlist; sign; sign = sign->next)
{
dict_T *d = dict_alloc();
if (d != NULL)
{
dict_add_nr_str(d, "id", sign->id, NULL);
dict_add_nr_str(d, "lnum", sign->lnum, NULL);
dict_add_nr_str(d, "name", 0L,
vim_strsave(sign_typenr2name(sign->typenr)));
list_append_dict(l, d);
}
}
}
#endif
/*
* Returns buffer options, variables and other attributes in a dictionary.
*/
static dict_T *
get_buffer_info(buf_T *buf)
{
dict_T *dict;
dict_T *opts;
dict_T *vars;
tabpage_T *tp;
win_T *wp;
list_T *windows;
dict = dict_alloc();
if (dict == NULL)
return NULL;
dict_add_nr_str(dict, "nr", buf->b_fnum, NULL);
dict_add_nr_str(dict, "name", 0L,
buf->b_ffname != NULL ? buf->b_ffname : (char_u *)"");
dict_add_nr_str(dict, "lnum", buflist_findlnum(buf), NULL);
dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL);
dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL);
dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL);
dict_add_nr_str(dict, "changedtick", buf->b_changedtick, NULL);
dict_add_nr_str(dict, "hidden",
buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0,
NULL);
/* Copy buffer variables */
vars = dict_copy(buf->b_vars, TRUE, 0);
if (vars != NULL)
dict_add_dict(dict, "variables", vars);
/* Copy buffer options */
opts = get_winbuf_options(TRUE);
if (opts != NULL)
dict_add_dict(dict, "options", opts);
/* List of windows displaying this buffer */
windows = list_alloc();
if (windows != NULL)
{
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_buffer == buf)
list_append_number(windows, (varnumber_T)wp->w_id);
dict_add_list(dict, "windows", windows);
}
#ifdef FEAT_SIGNS
if (buf->b_signlist != NULL)
{
/* List of signs placed in this buffer */
list_T *signs = list_alloc();
if (signs != NULL)
{
get_buffer_signs(buf, signs);
dict_add_list(dict, "signs", signs);
}
}
#endif
return dict;
}
/*
* "getbufinfo()" function
*/
static void
f_getbufinfo(typval_T *argvars, typval_T *rettv)
{
buf_T *buf = NULL;
buf_T *argbuf = NULL;
dict_T *d;
int filtered = FALSE;
int sel_buflisted = FALSE;
int sel_bufloaded = FALSE;
if (rettv_list_alloc(rettv) != OK)
return;
/* List of all the buffers or selected buffers */
if (argvars[0].v_type == VAR_DICT)
{
dict_T *sel_d = argvars[0].vval.v_dict;
if (sel_d != NULL)
{
dictitem_T *di;
filtered = TRUE;
di = dict_find(sel_d, (char_u *)"buflisted", -1);
if (di != NULL && get_tv_number(&di->di_tv))
sel_buflisted = TRUE;
di = dict_find(sel_d, (char_u *)"bufloaded", -1);
if (di != NULL && get_tv_number(&di->di_tv))
sel_bufloaded = TRUE;
}
}
else if (argvars[0].v_type != VAR_UNKNOWN)
{
/* Information about one buffer. Argument specifies the buffer */
(void)get_tv_number(&argvars[0]); /* issue errmsg if type error */
++emsg_off;
argbuf = get_buf_tv(&argvars[0], FALSE);
--emsg_off;
if (argbuf == NULL)
return;
}
/* Return information about all the buffers or a specified buffer */
FOR_ALL_BUFFERS(buf)
{
if (argbuf != NULL && argbuf != buf)
continue;
if (filtered && ((sel_bufloaded && buf->b_ml.ml_mfp == NULL)
|| (sel_buflisted && !buf->b_p_bl)))
continue;
d = get_buffer_info(buf);
if (d != NULL)
list_append_dict(rettv->vval.v_list, d);
if (argbuf != NULL)
return;
}
}
static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retlist, typval_T *rettv);
/*
@@ -4227,12 +4389,20 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
{
char_u *pat;
expand_T xpc;
int filtered = FALSE;
int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH
| WILD_NO_BEEP;
if (argvars[2].v_type != VAR_UNKNOWN)
filtered = get_tv_number_chk(&argvars[2], NULL);
if (p_wic)
options |= WILD_ICASE;
/* For filtered results, 'wildignore' is used */
if (!filtered)
options |= WILD_KEEP_ALL;
ExpandInit(&xpc);
xpc.xp_pattern = get_tv_string(&argvars[0]);
xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern);
@@ -4536,6 +4706,49 @@ f_getline(typval_T *argvars, typval_T *rettv)
get_buffer_lines(curbuf, lnum, end, retlist, rettv);
}
#ifdef FEAT_QUICKFIX
static void
get_qf_loc_list(int is_qf, win_T *wp, typval_T *what_arg, typval_T *rettv)
{
if (what_arg->v_type == VAR_UNKNOWN)
{
if (rettv_list_alloc(rettv) == OK)
if (is_qf || wp != NULL)
(void)get_errorlist(wp, -1, rettv->vval.v_list);
}
else
{
if (rettv_dict_alloc(rettv) == OK)
if (is_qf || (wp != NULL))
{
if (what_arg->v_type == VAR_DICT)
{
dict_T *d = what_arg->vval.v_dict;
if (d != NULL)
get_errorlist_properties(wp, d, rettv->vval.v_dict);
}
else
EMSG(_(e_dictreq));
}
}
}
#endif
/*
* "getloclist()" function
*/
static void
f_getloclist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_QUICKFIX
win_T *wp;
wp = find_win_by_nr(&argvars[0], NULL);
get_qf_loc_list(FALSE, wp, &argvars[1], rettv);
#endif
}
/*
* "getmatches()" function
*/
@@ -4673,28 +4886,13 @@ f_getpos(typval_T *argvars, typval_T *rettv)
}
/*
* "getqflist()" and "getloclist()" functions
* "getqflist()" function
*/
static void
f_getqflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_QUICKFIX
win_T *wp;
#endif
#ifdef FEAT_QUICKFIX
if (rettv_list_alloc(rettv) == OK)
{
wp = NULL;
if (argvars[0].v_type != VAR_UNKNOWN) /* getloclist() */
{
wp = find_win_by_nr(&argvars[0], NULL);
if (wp == NULL)
return;
}
(void)get_errorlist(wp, rettv->vval.v_list);
}
get_qf_loc_list(TRUE, NULL, &argvars[0], rettv);
#endif
}
@@ -4793,6 +4991,80 @@ f_getregtype(typval_T *argvars, typval_T *rettv)
rettv->vval.v_string = vim_strsave(buf);
}
#ifdef FEAT_WINDOWS
/*
* Returns information (variables, options, etc.) about a tab page
* as a dictionary.
*/
static dict_T *
get_tabpage_info(tabpage_T *tp, int tp_idx)
{
win_T *wp;
dict_T *dict;
dict_T *vars;
list_T *l;
dict = dict_alloc();
if (dict == NULL)
return NULL;
dict_add_nr_str(dict, "nr", tp_idx, NULL);
l = list_alloc();
if (l != NULL)
{
for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
wp; wp = wp->w_next)
list_append_number(l, (varnumber_T)wp->w_id);
dict_add_list(dict, "windows", l);
}
/* Copy tabpage variables */
vars = dict_copy(tp->tp_vars, TRUE, 0);
if (vars != NULL)
dict_add_dict(dict, "variables", vars);
return dict;
}
#endif
/*
* "gettabinfo()" function
*/
static void
f_gettabinfo(typval_T *argvars, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
tabpage_T *tp, *tparg = NULL;
dict_T *d;
int tpnr = 0;
if (rettv_list_alloc(rettv) != OK)
return;
if (argvars[0].v_type != VAR_UNKNOWN)
{
/* Information about one tab page */
tparg = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
if (tparg == NULL)
return;
}
/* Get information about a specific tab page or all tab pages */
FOR_ALL_TABPAGES(tp)
{
tpnr++;
if (tparg != NULL && tp != tparg)
continue;
d = get_tabpage_info(tp, tpnr);
if (d != NULL)
list_append_dict(rettv->vval.v_list, d);
if (tparg != NULL)
return;
}
#endif
}
/*
* "gettabvar()" function
*/
@@ -4845,6 +5117,95 @@ f_gettabwinvar(typval_T *argvars, typval_T *rettv)
getwinvar(argvars, rettv, 1);
}
#ifdef FEAT_WINDOWS
/*
* Returns information about a window as a dictionary.
*/
static dict_T *
get_win_info(win_T *wp, short tpnr, short winnr)
{
dict_T *dict;
dict_T *vars;
dict_T *opts;
dict = dict_alloc();
if (dict == NULL)
return NULL;
dict_add_nr_str(dict, "tpnr", tpnr, NULL);
dict_add_nr_str(dict, "nr", winnr, NULL);
dict_add_nr_str(dict, "winid", wp->w_id, NULL);
dict_add_nr_str(dict, "height", wp->w_height, NULL);
dict_add_nr_str(dict, "width", wp->w_width, NULL);
dict_add_nr_str(dict, "bufnum", wp->w_buffer->b_fnum, NULL);
#ifdef FEAT_QUICKFIX
dict_add_nr_str(dict, "quickfix", bt_quickfix(wp->w_buffer), NULL);
dict_add_nr_str(dict, "loclist",
(bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL), NULL);
#endif
/* Copy window variables */
vars = dict_copy(wp->w_vars, TRUE, 0);
if (vars != NULL)
dict_add_dict(dict, "variables", vars);
/* Copy window options */
opts = get_winbuf_options(FALSE);
if (opts != NULL)
dict_add_dict(dict, "options", opts);
return dict;
}
#endif
/*
* "getwininfo()" function
*/
static void
f_getwininfo(typval_T *argvars, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
tabpage_T *tp;
win_T *wp = NULL, *wparg = NULL;
dict_T *d;
short tabnr = 0, winnr;
#endif
if (rettv_list_alloc(rettv) != OK)
return;
#ifdef FEAT_WINDOWS
if (argvars[0].v_type != VAR_UNKNOWN)
{
wparg = win_id2wp(argvars);
if (wparg == NULL)
return;
}
/* Collect information about either all the windows across all the tab
* pages or one particular window.
*/
FOR_ALL_TABPAGES(tp)
{
tabnr++;
winnr = 0;
FOR_ALL_WINDOWS_IN_TAB(tp, wp)
{
winnr++;
if (wparg != NULL && wp != wparg)
continue;
d = get_win_info(wp, tabnr, winnr);
if (d != NULL)
list_append_dict(rettv->vval.v_list, d);
if (wparg != NULL)
/* found information about a specific window */
return;
}
}
#endif
}
/*
* "getwinposx()" function
*/
@@ -9552,7 +9913,7 @@ f_setline(typval_T *argvars, typval_T *rettv)
appended_lines_mark(lcount, added);
}
static void set_qf_ll_list(win_T *wp, typval_T *list_arg, typval_T *action_arg, typval_T *rettv);
static void set_qf_ll_list(win_T *wp, typval_T *list_arg, typval_T *action_arg, typval_T *what_arg, typval_T *rettv);
/*
* Used by "setqflist()" and "setloclist()" functions
@@ -9562,6 +9923,7 @@ set_qf_ll_list(
win_T *wp UNUSED,
typval_T *list_arg UNUSED,
typval_T *action_arg UNUSED,
typval_T *what_arg UNUSED,
typval_T *rettv)
{
#ifdef FEAT_QUICKFIX
@@ -9578,6 +9940,8 @@ set_qf_ll_list(
else
{
list_T *l = list_arg->vval.v_list;
dict_T *d = NULL;
int valid_dict = TRUE;
if (action_arg->v_type == VAR_STRING)
{
@@ -9594,8 +9958,20 @@ set_qf_ll_list(
else
EMSG(_(e_stringreq));
if (l != NULL && action && set_errorlist(wp, l, action,
(char_u *)(wp == NULL ? "setqflist()" : "setloclist()")) == OK)
if (action_arg->v_type != VAR_UNKNOWN
&& what_arg->v_type != VAR_UNKNOWN)
{
if (what_arg->v_type == VAR_DICT)
d = what_arg->vval.v_dict;
else
{
EMSG(_(e_dictreq));
valid_dict = FALSE;
}
}
if (l != NULL && action && valid_dict && set_errorlist(wp, l, action,
(char_u *)(wp == NULL ? "setqflist()" : "setloclist()"), d) == OK)
rettv->vval.v_number = 0;
}
#endif
@@ -9613,7 +9989,7 @@ f_setloclist(typval_T *argvars, typval_T *rettv)
win = find_win_by_nr(&argvars[0], NULL);
if (win != NULL)
set_qf_ll_list(win, &argvars[1], &argvars[2], rettv);
set_qf_ll_list(win, &argvars[1], &argvars[2], &argvars[3], rettv);
}
/*
@@ -9781,7 +10157,7 @@ f_setpos(typval_T *argvars, typval_T *rettv)
static void
f_setqflist(typval_T *argvars, typval_T *rettv)
{
set_qf_ll_list(NULL, &argvars[0], &argvars[1], rettv);
set_qf_ll_list(NULL, &argvars[0], &argvars[1], &argvars[2], rettv);
}
/*
+80 -60
View File
@@ -4747,6 +4747,20 @@ check_secure(void)
static char_u *old_sub = NULL; /* previous substitute pattern */
static int global_need_beginline; /* call beginline() after ":g" */
/*
* Flags that are kept between calls to :substitute.
*/
typedef struct {
int do_all; /* do multiple substitutions per line */
int do_ask; /* ask for confirmation */
int do_count; /* count only */
int do_error; /* if false, ignore errors */
int do_print; /* print last line with subs. */
int do_list; /* list last line with subs. */
int do_number; /* list last line with line nr*/
int do_ic; /* ignore case flag */
} subflags_T;
/* do_sub()
*
* Perform a substitution from line eap->line1 to line eap->line2 using the
@@ -4762,14 +4776,11 @@ do_sub(exarg_T *eap)
linenr_T lnum;
long i = 0;
regmmatch_T regmatch;
static int do_all = FALSE; /* do multiple substitutions per line */
static int do_ask = FALSE; /* ask for confirmation */
static int do_count = FALSE; /* count only */
static int do_error = TRUE; /* if false, ignore errors */
static int do_print = FALSE; /* print last line with subs. */
static int do_list = FALSE; /* list last line with subs. */
static int do_number = FALSE; /* list last line with line nr*/
static int do_ic = 0; /* ignore case flag */
static subflags_T subflags = {FALSE, FALSE, FALSE, TRUE, FALSE,
FALSE, FALSE, 0};
#ifdef FEAT_EVAL
subflags_T subflags_save;
#endif
int save_do_all; /* remember user specified 'g' flag */
int save_do_ask; /* remember user specified 'c' flag */
char_u *pat = NULL, *sub = NULL; /* init for GCC */
@@ -4957,16 +4968,16 @@ do_sub(exarg_T *eap)
if (!p_ed)
{
if (p_gd) /* default is global on */
do_all = TRUE;
subflags.do_all = TRUE;
else
do_all = FALSE;
do_ask = FALSE;
subflags.do_all = FALSE;
subflags.do_ask = FALSE;
}
do_error = TRUE;
do_print = FALSE;
do_count = FALSE;
do_number = FALSE;
do_ic = 0;
subflags.do_error = TRUE;
subflags.do_print = FALSE;
subflags.do_count = FALSE;
subflags.do_number = FALSE;
subflags.do_ic = 0;
}
while (*cmd)
{
@@ -4975,40 +4986,40 @@ do_sub(exarg_T *eap)
* 'r' is never inverted.
*/
if (*cmd == 'g')
do_all = !do_all;
subflags.do_all = !subflags.do_all;
else if (*cmd == 'c')
do_ask = !do_ask;
subflags.do_ask = !subflags.do_ask;
else if (*cmd == 'n')
do_count = TRUE;
subflags.do_count = TRUE;
else if (*cmd == 'e')
do_error = !do_error;
subflags.do_error = !subflags.do_error;
else if (*cmd == 'r') /* use last used regexp */
which_pat = RE_LAST;
else if (*cmd == 'p')
do_print = TRUE;
subflags.do_print = TRUE;
else if (*cmd == '#')
{
do_print = TRUE;
do_number = TRUE;
subflags.do_print = TRUE;
subflags.do_number = TRUE;
}
else if (*cmd == 'l')
{
do_print = TRUE;
do_list = TRUE;
subflags.do_print = TRUE;
subflags.do_list = TRUE;
}
else if (*cmd == 'i') /* ignore case */
do_ic = 'i';
subflags.do_ic = 'i';
else if (*cmd == 'I') /* don't ignore case */
do_ic = 'I';
subflags.do_ic = 'I';
else
break;
++cmd;
}
if (do_count)
do_ask = FALSE;
if (subflags.do_count)
subflags.do_ask = FALSE;
save_do_all = do_all;
save_do_ask = do_ask;
save_do_all = subflags.do_all;
save_do_ask = subflags.do_ask;
/*
* check for a trailing count
@@ -5017,7 +5028,7 @@ do_sub(exarg_T *eap)
if (VIM_ISDIGIT(*cmd))
{
i = getdigits(&cmd);
if (i <= 0 && !eap->skip && do_error)
if (i <= 0 && !eap->skip && subflags.do_error)
{
EMSG(_(e_zerocount));
return;
@@ -5045,7 +5056,7 @@ do_sub(exarg_T *eap)
if (eap->skip) /* not executing commands, only parsing */
return;
if (!do_count && !curbuf->b_p_ma)
if (!subflags.do_count && !curbuf->b_p_ma)
{
/* Substitution is not allowed in non-'modifiable' buffer */
EMSG(_(e_modifiable));
@@ -5054,15 +5065,15 @@ do_sub(exarg_T *eap)
if (search_regcomp(pat, RE_SUBST, which_pat, SEARCH_HIS, &regmatch) == FAIL)
{
if (do_error)
if (subflags.do_error)
EMSG(_(e_invcmd));
return;
}
/* the 'i' or 'I' flag overrules 'ignorecase' and 'smartcase' */
if (do_ic == 'i')
if (subflags.do_ic == 'i')
regmatch.rmm_ic = TRUE;
else if (do_ic == 'I')
else if (subflags.do_ic == 'I')
regmatch.rmm_ic = FALSE;
sub_firstline = NULL;
@@ -5231,7 +5242,7 @@ do_sub(exarg_T *eap)
* 2. If do_count is set only increase the counter.
* If do_ask is set, ask for confirmation.
*/
if (do_count)
if (subflags.do_count)
{
/* For a multi-line match, put matchcol at the NUL at
* the end of the line and set nmatch to one, so that
@@ -5253,7 +5264,7 @@ do_sub(exarg_T *eap)
goto skip;
}
if (do_ask)
if (subflags.do_ask)
{
int typed = 0;
@@ -5274,19 +5285,20 @@ do_sub(exarg_T *eap)
/*
* Loop until 'y', 'n', 'q', CTRL-E or CTRL-Y typed.
*/
while (do_ask)
while (subflags.do_ask)
{
if (exmode_active)
{
char_u *resp;
colnr_T sc, ec;
print_line_no_prefix(lnum, do_number, do_list);
print_line_no_prefix(lnum,
subflags.do_number, subflags.do_list);
getvcol(curwin, &curwin->w_cursor, &sc, NULL, NULL);
curwin->w_cursor.col = regmatch.endpos[0].col - 1;
getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec);
if (do_number || curwin->w_p_nu)
if (subflags.do_number || curwin->w_p_nu)
{
int numw = number_width(curwin) + 1;
sc += numw;
@@ -5420,13 +5432,13 @@ do_sub(exarg_T *eap)
if (typed == 'l')
{
/* last: replace and then stop */
do_all = FALSE;
subflags.do_all = FALSE;
line2 = lnum;
break;
}
if (typed == 'a')
{
do_ask = FALSE;
subflags.do_ask = FALSE;
break;
}
#ifdef FEAT_INS_EXPAND
@@ -5469,23 +5481,29 @@ do_sub(exarg_T *eap)
* 3. substitute the string.
*/
#ifdef FEAT_EVAL
if (do_count)
if (subflags.do_count)
{
/* prevent accidentally changing the buffer by a function */
save_ma = curbuf->b_p_ma;
curbuf->b_p_ma = FALSE;
sandbox++;
}
/* Save flags for recursion. They can change for e.g.
* :s/^/\=execute("s#^##gn") */
subflags_save = subflags;
#endif
/* get length of substitution part */
sublen = vim_regsub_multi(&regmatch,
sub_firstlnum - regmatch.startpos[0].lnum,
sub, sub_firstline, FALSE, p_magic, TRUE);
#ifdef FEAT_EVAL
if (do_count)
/* Don't keep flags set by a recursive call. */
subflags = subflags_save;
if (subflags.do_count)
{
curbuf->b_p_ma = save_ma;
sandbox--;
if (sandbox > 0)
sandbox--;
goto skip;
}
#endif
@@ -5578,7 +5596,7 @@ do_sub(exarg_T *eap)
if (sub_firstlnum <= line2)
do_again = TRUE;
else
do_all = FALSE;
subflags.do_all = FALSE;
}
/* Remember next character to be copied. */
@@ -5613,7 +5631,7 @@ do_sub(exarg_T *eap)
ml_append(lnum - 1, new_start,
(colnr_T)(p1 - new_start + 1), FALSE);
mark_adjust(lnum + 1, (linenr_T)MAXLNUM, 1L, 0L);
if (do_ask)
if (subflags.do_ask)
appended_lines(lnum - 1, 1L);
else
{
@@ -5654,7 +5672,7 @@ skip:
|| got_int
|| got_quit
|| lnum > line2
|| !(do_all || do_again)
|| !(subflags.do_all || do_again)
|| (sub_firstline[matchcol] == NUL && nmatch <= 1
&& !re_multiline(regmatch.regprog)));
nmatch = -1;
@@ -5708,7 +5726,7 @@ skip:
ml_delete(lnum, (int)FALSE);
mark_adjust(lnum, lnum + nmatch_tl - 1,
(long)MAXLNUM, -nmatch_tl);
if (do_ask)
if (subflags.do_ask)
deleted_lines(lnum, nmatch_tl);
--lnum;
line2 -= nmatch_tl; /* nr of lines decreases */
@@ -5717,7 +5735,7 @@ skip:
/* When asking, undo is saved each time, must also set
* changed flag each time. */
if (do_ask)
if (subflags.do_ask)
changed_bytes(lnum, 0);
else
{
@@ -5779,7 +5797,7 @@ outofmem:
vim_free(sub_firstline); /* may have to free allocated copy of the line */
/* ":s/pat//n" doesn't move the cursor */
if (do_count)
if (subflags.do_count)
curwin->w_cursor = old_cursor;
if (sub_nsubs > start_nsubs)
@@ -5791,20 +5809,22 @@ outofmem:
if (!global_busy)
{
if (!do_ask) /* when interactive leave cursor on the match */
/* when interactive leave cursor on the match */
if (!subflags.do_ask)
{
if (endcolumn)
coladvance((colnr_T)MAXCOL);
else
beginline(BL_WHITE | BL_FIX);
}
if (!do_sub_msg(do_count) && do_ask)
if (!do_sub_msg(subflags.do_count) && subflags.do_ask)
MSG("");
}
else
global_need_beginline = TRUE;
if (do_print)
print_line(curwin->w_cursor.lnum, do_number, do_list);
if (subflags.do_print)
print_line(curwin->w_cursor.lnum,
subflags.do_number, subflags.do_list);
}
else if (!global_busy)
{
@@ -5812,12 +5832,12 @@ outofmem:
EMSG(_(e_interr));
else if (got_match) /* did find something but nothing substituted */
MSG("");
else if (do_error) /* nothing found */
else if (subflags.do_error) /* nothing found */
EMSG2(_(e_patnotf2), get_search_pat());
}
#ifdef FEAT_FOLDING
if (do_ask && hasAnyFolding(curwin))
if (subflags.do_ask && hasAnyFolding(curwin))
/* Cursor position may require updating */
changed_window_setting();
#endif
@@ -5825,8 +5845,8 @@ outofmem:
vim_regfree(regmatch.regprog);
/* Restore the flag values, they can be used for ":&&". */
do_all = save_do_all;
do_ask = save_do_ask;
subflags.do_all = save_do_all;
subflags.do_ask = save_do_ask;
}
/*
+3 -7
View File
@@ -3060,7 +3060,7 @@ inchar(
if (typebuf_changed(tb_change_cnt))
return 0;
return fix_input_buffer(buf, len, script_char >= 0);
return fix_input_buffer(buf, len);
}
/*
@@ -3069,10 +3069,7 @@ inchar(
* Returns the new length.
*/
int
fix_input_buffer(
char_u *buf,
int len,
int script) /* TRUE when reading from a script */
fix_input_buffer(char_u *buf, int len)
{
int i;
char_u *p = buf;
@@ -3083,7 +3080,6 @@ fix_input_buffer(
* Replace NUL by K_SPECIAL KS_ZERO KE_FILLER
* Replace K_SPECIAL by K_SPECIAL KS_SPECIAL KE_FILLER
* Replace CSI by K_SPECIAL KS_EXTRA KE_CSI
* Don't replace K_SPECIAL when reading a script file.
*/
for (i = len; --i >= 0; ++p)
{
@@ -3106,7 +3102,7 @@ fix_input_buffer(
}
else
#endif
if (p[0] == NUL || (p[0] == K_SPECIAL && !script
if (p[0] == NUL || (p[0] == K_SPECIAL
#ifdef FEAT_AUTOCMD
/* timeout may generate K_CURSORHOLD */
&& (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD)
+1 -1
View File
@@ -1513,7 +1513,7 @@ EXTERN char_u e_notread[] INIT(= N_("E485: Can't read file %s"));
EXTERN char_u e_nowrtmsg[] INIT(= N_("E37: No write since last change (add ! to override)"));
EXTERN char_u e_nowrtmsg_nobang[] INIT(= N_("E37: No write since last change"));
EXTERN char_u e_null[] INIT(= N_("E38: Null argument"));
#ifdef FEAT_DIGRAPHS
#if defined(FEAT_DIGRAPHS) || defined(FEAT_TIMERS)
EXTERN char_u e_number_exp[] INIT(= N_("E39: Number expected"));
#endif
#ifdef FEAT_QUICKFIX
+3 -2
View File
@@ -1981,12 +1981,13 @@ gui_write(
* gui_can_update_cursor() afterwards.
*/
void
gui_dont_update_cursor(void)
gui_dont_update_cursor(int undraw)
{
if (gui.in_use)
{
/* Undraw the cursor now, we probably can't do it after the change. */
gui_undraw_cursor();
if (undraw)
gui_undraw_cursor();
can_update_cursor = FALSE;
}
}
+13 -9
View File
@@ -5239,7 +5239,7 @@ static PangoEngineShape *default_shape_engine = NULL;
static void
ascii_glyph_table_init(void)
{
char_u ascii_chars[128];
char_u ascii_chars[2 * 128];
PangoAttrList *attr_list;
GList *item_list;
int i;
@@ -5252,12 +5252,16 @@ ascii_glyph_table_init(void)
gui.ascii_glyphs = NULL;
gui.ascii_font = NULL;
/* For safety, fill in question marks for the control characters. */
for (i = 0; i < 32; ++i)
ascii_chars[i] = '?';
for (; i < 127; ++i)
ascii_chars[i] = i;
ascii_chars[i] = '?';
/* For safety, fill in question marks for the control characters.
* Put a space between characters to avoid shaping. */
for (i = 0; i < 128; ++i)
{
if (i >= 32 && i < 127)
ascii_chars[2 * i] = i;
else
ascii_chars[2 * i] = '?';
ascii_chars[2 * i + 1] = ' ';
}
attr_list = pango_attr_list_new();
item_list = pango_itemize(gui.text_context, (const char *)ascii_chars,
@@ -5946,7 +5950,7 @@ gui_gtk2_draw_string(int row, int col, char_u *s, int len, int flags)
for (i = 0; i < len; ++i)
{
glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[s[i]];
glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[2 * s[i]];
glyphs->log_clusters[i] = i;
}
@@ -6698,7 +6702,7 @@ check_copy_area(void)
* we don't want it to be. I'm not sure if it's correct to call
* gui_dont_update_cursor() at this point but it works as a quick
* fix for now. */
gui_dont_update_cursor();
gui_dont_update_cursor(TRUE);
do
{
+1 -1
View File
@@ -4830,7 +4830,7 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
char_u *p_actext;
p_actext = menu->actext;
key = find_special_key(&p_actext, &modifiers, FALSE, FALSE);
key = find_special_key(&p_actext, &modifiers, FALSE, FALSE, FALSE);
if (*p_actext != 0)
key = 0; /* error: trailing text */
/* find_special_key() returns a keycode with as many of the
+64 -13
View File
@@ -3891,7 +3891,7 @@ do_browse(
static char *e_printf = N_("E766: Insufficient arguments for printf()");
static varnumber_T tv_nr(typval_T *tvs, int *idxp);
static char *tv_str(typval_T *tvs, int *idxp);
static char *tv_str(typval_T *tvs, int *idxp, char_u **tofree);
# ifdef FEAT_FLOAT
static double tv_float(typval_T *tvs, int *idxp);
# endif
@@ -3920,20 +3920,28 @@ tv_nr(typval_T *tvs, int *idxp)
/*
* Get string argument from "idxp" entry in "tvs". First entry is 1.
* If "tofree" is NULL get_tv_string_chk() is used. Some types (e.g. List)
* are not converted to a string.
* If "tofree" is not NULL echo_string() is used. All types are converted to
* a string with the same format as ":echo". The caller must free "*tofree".
* Returns NULL for an error.
*/
static char *
tv_str(typval_T *tvs, int *idxp)
tv_str(typval_T *tvs, int *idxp, char_u **tofree)
{
int idx = *idxp - 1;
char *s = NULL;
int idx = *idxp - 1;
char *s = NULL;
static char_u numbuf[NUMBUFLEN];
if (tvs[idx].v_type == VAR_UNKNOWN)
EMSG(_(e_printf));
else
{
++*idxp;
s = (char *)get_tv_string_chk(&tvs[idx]);
if (tofree != NULL)
s = (char *)echo_string(&tvs[idx], tofree, numbuf, get_copyID());
else
s = (char *)get_tv_string_chk(&tvs[idx]);
}
return s;
}
@@ -4087,12 +4095,14 @@ vim_vsnprintf(
char length_modifier = '\0';
/* temporary buffer for simple numeric->string conversion */
# ifdef FEAT_FLOAT
# if defined(FEAT_FLOAT)
# define TMP_LEN 350 /* On my system 1e308 is the biggest number possible.
* That sounds reasonable to use as the maximum
* printable. */
# elif defined(FEAT_NUM64)
# define TMP_LEN 66
# else
# define TMP_LEN 32
# define TMP_LEN 34
# endif
char tmp[TMP_LEN];
@@ -4117,6 +4127,10 @@ vim_vsnprintf(
/* current conversion specifier character */
char fmt_spec = '\0';
/* buffer for 's' and 'S' specs */
char_u *tofree = NULL;
str_arg = NULL;
p++; /* skip '%' */
@@ -4280,7 +4294,7 @@ vim_vsnprintf(
case 'S':
str_arg =
# if defined(FEAT_EVAL)
tvs != NULL ? tv_str(tvs, &arg_idx) :
tvs != NULL ? tv_str(tvs, &arg_idx, &tofree) :
# endif
va_arg(ap, char *);
if (str_arg == NULL)
@@ -4335,9 +4349,13 @@ vim_vsnprintf(
}
break;
case 'd': case 'u': case 'o': case 'x': case 'X': case 'p':
case 'd': case 'u':
case 'b': case 'B':
case 'o':
case 'x': case 'X':
case 'p':
{
/* NOTE: the u, o, x, X and p conversion specifiers
/* NOTE: the u, b, o, x, X and p conversion specifiers
* imply the value is unsigned; d implies a signed
* value */
@@ -4362,6 +4380,9 @@ vim_vsnprintf(
uvarnumber_T ullong_arg = 0;
# endif
/* only defined for b convertion */
uvarnumber_T bin_arg = 0;
/* pointer argument value -only defined for p
* conversion */
void *ptr_arg = NULL;
@@ -4371,12 +4392,24 @@ vim_vsnprintf(
length_modifier = '\0';
ptr_arg =
# if defined(FEAT_EVAL)
tvs != NULL ? (void *)tv_str(tvs, &arg_idx) :
tvs != NULL ? (void *)tv_str(tvs, &arg_idx,
NULL) :
# endif
va_arg(ap, void *);
if (ptr_arg != NULL)
arg_sign = 1;
}
else if (fmt_spec == 'b' || fmt_spec == 'B')
{
bin_arg =
# if defined(FEAT_EVAL)
tvs != NULL ?
(uvarnumber_T)tv_nr(tvs, &arg_idx) :
# endif
va_arg(ap, uvarnumber_T);
if (bin_arg != 0)
arg_sign = 1;
}
else if (fmt_spec == 'd')
{
/* signed */
@@ -4483,7 +4516,8 @@ vim_vsnprintf(
else if (alternate_form)
{
if (arg_sign != 0
&& (fmt_spec == 'x' || fmt_spec == 'X') )
&& (fmt_spec == 'b' || fmt_spec == 'B'
|| fmt_spec == 'x' || fmt_spec == 'X') )
{
tmp[str_arg_l++] = '0';
tmp[str_arg_l++] = fmt_spec;
@@ -4499,7 +4533,7 @@ vim_vsnprintf(
{
/* When zero value is formatted with an explicit
* precision 0, the resulting formatted string is
* empty (d, i, u, o, x, X, p). */
* empty (d, i, u, b, B, o, x, X, p). */
}
else
{
@@ -4532,6 +4566,22 @@ vim_vsnprintf(
if (fmt_spec == 'p')
str_arg_l += sprintf(tmp + str_arg_l, f, ptr_arg);
else if (fmt_spec == 'b' || fmt_spec == 'B')
{
char b[8 * sizeof(uvarnumber_T)];
size_t b_l = 0;
uvarnumber_T bn = bin_arg;
do
{
b[sizeof(b) - ++b_l] = '0' + (bn & 0x1);
bn >>= 1;
}
while (bn != 0);
memcpy(tmp + str_arg_l, b + sizeof(b) - b_l, b_l);
str_arg_l += b_l;
}
else if (fmt_spec == 'd')
{
/* signed */
@@ -4881,6 +4931,7 @@ vim_vsnprintf(
str_l += pn;
}
}
vim_free(tofree);
}
}
+1 -1
View File
@@ -3416,7 +3416,7 @@ get_keystroke(void)
if (n > 0)
{
/* Replace zero and CSI by a special key code. */
n = fix_input_buffer(buf + len, n, FALSE);
n = fix_input_buffer(buf + len, n);
len += n;
waited = 0;
}
+21 -13
View File
@@ -2680,13 +2680,14 @@ get_special_key_name(int c, int modifiers)
trans_special(
char_u **srcp,
char_u *dst,
int keycode) /* prefer key code, e.g. K_DEL instead of DEL */
int keycode, /* prefer key code, e.g. K_DEL instead of DEL */
int in_string) /* TRUE when inside a double quoted string */
{
int modifiers = 0;
int key;
int dlen = 0;
key = find_special_key(srcp, &modifiers, keycode, FALSE);
key = find_special_key(srcp, &modifiers, keycode, FALSE, in_string);
if (key == 0)
return 0;
@@ -2726,7 +2727,8 @@ find_special_key(
char_u **srcp,
int *modp,
int keycode, /* prefer key code, e.g. K_DEL instead of DEL */
int keep_x_key) /* don't translate xHome to Home key */
int keep_x_key, /* don't translate xHome to Home key */
int in_string) /* TRUE in string, double quote is escaped */
{
char_u *last_dash;
char_u *end_of_name;
@@ -2757,10 +2759,14 @@ find_special_key(
else
#endif
l = 1;
/* Anything accepted, like <C-?>, except <C-">, because the "
* ends the string. */
if (bp[l] != '"' && bp[l + 1] == '>')
/* Anything accepted, like <C-?>.
* <C-"> or <M-"> are not special in strings as " is
* the string delimiter. With a backslash it works: <M-\"> */
if (!(in_string && bp[1] == '"') && bp[2] == '>')
bp += l;
else if (in_string && bp[1] == '\\' && bp[2] == '"'
&& bp[3] == '>')
bp += 2;
}
}
if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3])
@@ -2804,20 +2810,22 @@ find_special_key(
}
else
{
/*
* Modifier with single letter, or special key name.
*/
int off = 1;
/* Modifier with single letter, or special key name. */
if (in_string && last_dash[1] == '\\' && last_dash[2] == '"')
off = 2;
#ifdef FEAT_MBYTE
if (has_mbyte)
l = mb_ptr2len(last_dash + 1);
l = mb_ptr2len(last_dash + off);
else
#endif
l = 1;
if (modifiers != 0 && last_dash[l + 1] == '>')
key = PTR2CHAR(last_dash + 1);
if (modifiers != 0 && last_dash[l + off] == '>')
key = PTR2CHAR(last_dash + off);
else
{
key = get_special_key_code(last_dash + 1);
key = get_special_key_code(last_dash + off);
if (!keep_x_key)
key = handle_x_keys(key);
}
+1 -6
View File
@@ -919,12 +919,7 @@ win_col_off(win_T *wp)
+ wp->w_p_fdc
#endif
#ifdef FEAT_SIGNS
+ (
# ifdef FEAT_NETBEANS_INTG
/* show glyph gutter in netbeans */
wp->w_buffer->b_has_sign_column ||
# endif
wp->w_buffer->b_signlist != NULL ? 2 : 0)
+ (signcolumn_on(wp) ? 2 : 0)
#endif
);
}
+94 -2
View File
@@ -256,6 +256,9 @@
# define PV_COCU OPT_WIN(WV_COCU)
# define PV_COLE OPT_WIN(WV_COLE)
#endif
#ifdef FEAT_SIGNS
# define PV_SCL OPT_WIN(WV_SCL)
#endif
/* WV_ and BV_ values get typecasted to this for the "indir" field */
typedef enum
@@ -474,7 +477,7 @@ struct vimoption
#if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
|| defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \
|| defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) || defined(FEAT_CONCEAL)
# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn"
# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn"
#else
# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
#endif
@@ -2458,6 +2461,15 @@ static struct vimoption options[] =
{"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
(char_u *)&p_siso, PV_NONE,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"signcolumn", "scl", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN,
#ifdef FEAT_SIGNS
(char_u *)VAR_WIN, PV_SCL,
{(char_u *)"auto", (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)NULL, (char_u *)0L}
#endif
SCRIPTID_INIT},
{"slowopen", "slow", P_BOOL|P_VI_DEF,
(char_u *)NULL, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
@@ -3131,6 +3143,9 @@ static char *(p_fcl_values[]) = {"all", NULL};
#ifdef FEAT_INS_EXPAND
static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "noinsert", "noselect", NULL};
#endif
#ifdef FEAT_SIGNS
static char *(p_scl_values[]) = {"yes", "no", "auto", NULL};
#endif
static void set_option_default(int, int opt_flags, int compatible);
static void set_options_default(int opt_flags);
@@ -7063,6 +7078,15 @@ did_set_string_option(
}
#endif /* FEAT_INS_EXPAND */
#ifdef FEAT_SIGNS
/* 'signcolumn' */
else if (varp == &curwin->w_p_scl)
{
if (check_opt_strings(*varp, p_scl_values, FALSE) != OK)
errmsg = e_invarg;
}
#endif
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
else if (varp == &p_toolbar)
@@ -9620,7 +9644,7 @@ find_key_option(char_u *arg)
{
--arg; /* put arg at the '<' */
modifiers = 0;
key = find_special_key(&arg, &modifiers, TRUE, TRUE);
key = find_special_key(&arg, &modifiers, TRUE, TRUE, FALSE);
if (modifiers) /* can't handle modifiers here */
key = 0;
}
@@ -10601,6 +10625,9 @@ get_varp(struct vimoption *p)
case PV_WM: return (char_u *)&(curbuf->b_p_wm);
#ifdef FEAT_KEYMAP
case PV_KMAP: return (char_u *)&(curbuf->b_p_keymap);
#endif
#ifdef FEAT_SIGNS
case PV_SCL: return (char_u *)&(curwin->w_p_scl);
#endif
default: EMSG(_("E356: get_varp ERROR"));
}
@@ -10717,6 +10744,9 @@ copy_winopt(winopt_T *from, winopt_T *to)
to->wo_fdt = vim_strsave(from->wo_fdt);
# endif
to->wo_fmr = vim_strsave(from->wo_fmr);
#endif
#ifdef FEAT_SIGNS
to->wo_scl = vim_strsave(from->wo_scl);
#endif
check_winopt(to); /* don't want NULL pointers */
}
@@ -10747,6 +10777,9 @@ check_winopt(winopt_T *wop UNUSED)
# endif
check_string_option(&wop->wo_fmr);
#endif
#ifdef FEAT_SIGNS
check_string_option(&wop->wo_scl);
#endif
#ifdef FEAT_RIGHTLEFT
check_string_option(&wop->wo_rlc);
#endif
@@ -10780,6 +10813,9 @@ clear_winopt(winopt_T *wop UNUSED)
# endif
clear_string_option(&wop->wo_fmr);
#endif
#ifdef FEAT_SIGNS
clear_string_option(&wop->wo_scl);
#endif
#ifdef FEAT_LINEBREAK
clear_string_option(&wop->wo_briopt);
#endif
@@ -12538,3 +12574,59 @@ get_bkc_value(buf_T *buf)
{
return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags;
}
#if defined(FEAT_SIGNS) || defined(PROTO)
/*
* Return TRUE when window "wp" has a column to draw signs in.
*/
int
signcolumn_on(win_T *wp)
{
if (*wp->w_p_scl == 'n')
return FALSE;
if (*wp->w_p_scl == 'y')
return TRUE;
return (wp->w_buffer->b_signlist != NULL
# ifdef FEAT_NETBEANS_INTG
|| wp->w_buffer->b_has_sign_column
# endif
);
}
#endif
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Get window or buffer local options.
*/
dict_T *
get_winbuf_options(int bufopt)
{
dict_T *d;
int opt_idx;
d = dict_alloc();
if (d == NULL)
return NULL;
for (opt_idx = 0; !istermoption(&options[opt_idx]); opt_idx++)
{
struct vimoption *opt = &options[opt_idx];
if ((bufopt && (opt->indir & PV_BUF))
|| (!bufopt && (opt->indir & PV_WIN)))
{
char_u *varp = get_varp(opt);
if (varp != NULL)
{
if (opt->flags & P_STRING)
dict_add_nr_str(d, opt->fullname, 0L, *(char_u **)varp);
else
dict_add_nr_str(d, opt->fullname, *varp, NULL);
}
}
}
return d;
}
#endif
+6
View File
@@ -648,6 +648,9 @@ EXTERN int p_magic; /* 'magic' */
EXTERN char_u *p_mef; /* 'makeef' */
EXTERN char_u *p_mp; /* 'makeprg' */
#endif
#ifdef FEAT_SIGNS
EXTERN char_u *p_scl; /* signcolumn */
#endif
#ifdef FEAT_SYN_HL
EXTERN char_u *p_cc; /* 'colorcolumn' */
EXTERN int p_cc_cols[256]; /* array for 'colorcolumn' columns */
@@ -1195,6 +1198,9 @@ enum
, WV_WFW
#endif
, WV_WRAP
#ifdef FEAT_SIGNS
, WV_SCL
#endif
, WV_COUNT /* must be the last one */
};
+5 -1
View File
@@ -2261,7 +2261,11 @@ vim_is_xterm(char_u *name)
use_xterm_like_mouse(char_u *name)
{
return (name != NULL
&& (term_is_xterm || STRNICMP(name, "screen", 6) == 0));
&& (term_is_xterm
|| STRNICMP(name, "screen", 6) == 0
|| STRICMP(name, "st") == 0
|| STRNICMP(name, "st-", 3) == 0
|| STRNICMP(name, "stterm", 6) == 0));
}
#endif
+1
View File
@@ -11,6 +11,7 @@ dict_T *dict_copy(dict_T *orig, int deep, int copyID);
int dict_add(dict_T *d, dictitem_T *item);
int dict_add_nr_str(dict_T *d, char *key, varnumber_T nr, char_u *str);
int dict_add_list(dict_T *d, char *key, list_T *list);
int dict_add_dict(dict_T *d, char *key, dict_T *dict);
long dict_len(dict_T *d);
dictitem_T *dict_find(dict_T *d, char_u *key, int len);
char_u *get_dict_string(dict_T *d, char_u *key, int save);
+1 -1
View File
@@ -47,7 +47,7 @@ int vpeekc_nomap(void);
int vpeekc_any(void);
int char_avail(void);
void vungetc(int c);
int fix_input_buffer(char_u *buf, int len, int script);
int fix_input_buffer(char_u *buf, int len);
int input_available(void);
int do_map(int maptype, char_u *arg, int mode, int abbrev);
int get_map_mode(char_u **cmdp, int forceit);
+1 -1
View File
@@ -23,7 +23,7 @@ void gui_stop_highlight(int mask);
void gui_clear_block(int row1, int col1, int row2, int col2);
void gui_update_cursor_later(void);
void gui_write(char_u *s, int len);
void gui_dont_update_cursor(void);
void gui_dont_update_cursor(int undraw);
void gui_can_update_cursor(void);
int gui_outstr_nowrap(char_u *s, int len, int flags, guicolor_T fg, guicolor_T bg, int back);
void gui_undraw_cursor(void);
+2 -2
View File
@@ -64,8 +64,8 @@ int name_to_mod_mask(int c);
int simplify_key(int key, int *modifiers);
int handle_x_keys(int key);
char_u *get_special_key_name(int c, int modifiers);
int trans_special(char_u **srcp, char_u *dst, int keycode);
int find_special_key(char_u **srcp, int *modp, int keycode, int keep_x_key);
int trans_special(char_u **srcp, char_u *dst, int keycode, int in_string);
int find_special_key(char_u **srcp, int *modp, int keycode, int keep_x_key, int in_string);
int extract_modifiers(int key, int *modp);
int find_special_key_in_table(int c);
int get_special_key_code(char_u *name);
+2
View File
@@ -63,4 +63,6 @@ long get_sw_value(buf_T *buf);
long get_sts_value(void);
void find_mps_values(int *initc, int *findc, int *backwards, int switchit);
unsigned int get_bkc_value(buf_T *buf);
int signcolumn_on(win_T *wp);
dict_T *get_winbuf_options(int bufopt);
/* vim: set ft=c : */
+3 -2
View File
@@ -27,8 +27,9 @@ void ex_cnext(exarg_T *eap);
void ex_cfile(exarg_T *eap);
void ex_vimgrep(exarg_T *eap);
char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags);
int get_errorlist(win_T *wp, list_T *list);
int set_errorlist(win_T *wp, list_T *list, int action, char_u *title);
int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict);
int get_errorlist(win_T *wp, int qf_idx, list_T *list);
int set_errorlist(win_T *wp, list_T *list, int action, char_u *title, dict_T *what);
void ex_cbuffer(exarg_T *eap);
void ex_cexpr(exarg_T *eap);
void ex_helpgrep(exarg_T *eap);
+2
View File
@@ -4,6 +4,7 @@ void get_wincmd_addr_type(char_u *arg, exarg_T *eap);
int win_split(int size, int flags);
int win_split_ins(int size, int flags, win_T *new_wp, int dir);
int win_valid(win_T *win);
int win_valid_any_tab(win_T *win);
int win_count(void);
int make_windows(int count, int vertical);
void win_move_after(win_T *win1, win_T *win2);
@@ -86,6 +87,7 @@ int get_tab_number(tabpage_T *tp);
int win_getid(typval_T *argvars);
int win_gotoid(typval_T *argvars);
void win_id2tabwin(typval_T *argvars, list_T *list);
win_T *win_id2wp(typval_T *argvars);
int win_id2win(typval_T *argvars);
void win_findbuf(typval_T *argvars, list_T *list);
/* vim: set ft=c : */
+181 -29
View File
@@ -3140,6 +3140,24 @@ qf_find_buf(qf_info_T *qi)
return NULL;
}
/*
* Update the w:quickfix_title variable in the quickfix/location list window
*/
static void
qf_update_win_titlevar(qf_info_T *qi)
{
win_T *win;
win_T *curwin_save;
if ((win = qf_find_win(qi)) != NULL)
{
curwin_save = curwin;
curwin = win;
qf_set_title_var(qi);
curwin = curwin_save;
}
}
/*
* Find the quickfix buffer. If it exists, update the contents.
*/
@@ -3148,7 +3166,6 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last)
{
buf_T *buf;
win_T *win;
win_T *curwin_save;
aco_save_T aco;
/* Check if a buffer for the quickfix list exists. Update it. */
@@ -3161,13 +3178,7 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last)
/* set curwin/curbuf to buf and save a few things */
aucmd_prepbuf(&aco, buf);
if ((win = qf_find_win(qi)) != NULL)
{
curwin_save = curwin;
curwin = win;
qf_set_title_var(qi);
curwin = curwin_save;
}
qf_update_win_titlevar(qi);
qf_fill_buffer(qi, buf, old_last);
@@ -4532,9 +4543,10 @@ unload_dummy_buffer(buf_T *buf, char_u *dirname_start)
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Add each quickfix error to list "list" as a dictionary.
* If qf_idx is -1, use the current list. Otherwise, use the specified list.
*/
int
get_errorlist(win_T *wp, list_T *list)
get_errorlist(win_T *wp, int qf_idx, list_T *list)
{
qf_info_T *qi = &ql_info;
dict_T *dict;
@@ -4550,12 +4562,15 @@ get_errorlist(win_T *wp, list_T *list)
return FAIL;
}
if (qi->qf_curlist >= qi->qf_listcount
|| qi->qf_lists[qi->qf_curlist].qf_count == 0)
if (qf_idx == -1)
qf_idx = qi->qf_curlist;
if (qf_idx >= qi->qf_listcount
|| qi->qf_lists[qf_idx].qf_count == 0)
return FAIL;
qfp = qi->qf_lists[qi->qf_curlist].qf_start;
for (i = 1; !got_int && i <= qi->qf_lists[qi->qf_curlist].qf_count; ++i)
qfp = qi->qf_lists[qf_idx].qf_start;
for (i = 1; !got_int && i <= qi->qf_lists[qf_idx].qf_count; ++i)
{
/* Handle entries with a non-existing buffer number. */
bufnum = qfp->qf_fnum;
@@ -4590,16 +4605,93 @@ get_errorlist(win_T *wp, list_T *list)
}
/*
* Populate the quickfix list with the items supplied in the list
* of dictionaries. "title" will be copied to w:quickfix_title.
* "action" is 'a' for add, 'r' for replace. Otherwise create a new list.
* Flags used by getqflist()/getloclist() to determine which fields to return.
*/
enum {
QF_GETLIST_NONE = 0x0,
QF_GETLIST_TITLE = 0x1,
QF_GETLIST_ITEMS = 0x2,
QF_GETLIST_NR = 0x4,
QF_GETLIST_WINID = 0x8,
QF_GETLIST_ALL = 0xFF
};
/*
* Return quickfix/location list details (title) as a
* dictionary. 'what' contains the details to return. If 'list_idx' is -1,
* then current list is used. Otherwise the specified list is used.
*/
int
set_errorlist(
win_T *wp,
list_T *list,
int action,
char_u *title)
get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
{
qf_info_T *qi = &ql_info;
int status = OK;
int qf_idx;
dictitem_T *di;
int flags = QF_GETLIST_NONE;
if (wp != NULL)
{
qi = GET_LOC_LIST(wp);
if (qi == NULL)
return FAIL;
}
qf_idx = qi->qf_curlist; /* default is the current list */
if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL)
{
/* Use the specified quickfix/location list */
if (di->di_tv.v_type == VAR_NUMBER)
{
qf_idx = di->di_tv.vval.v_number - 1;
if (qf_idx < 0 || qf_idx >= qi->qf_listcount)
return FAIL;
flags |= QF_GETLIST_NR;
}
else
return FAIL;
}
if (dict_find(what, (char_u *)"all", -1) != NULL)
flags |= QF_GETLIST_ALL;
if (dict_find(what, (char_u *)"title", -1) != NULL)
flags |= QF_GETLIST_TITLE;
if (dict_find(what, (char_u *)"winid", -1) != NULL)
flags |= QF_GETLIST_WINID;
if (flags & QF_GETLIST_TITLE)
{
char_u *t;
t = qi->qf_lists[qf_idx].qf_title;
if (t == NULL)
t = (char_u *)"";
status = dict_add_nr_str(retdict, "title", 0L, t);
}
if ((status == OK) && (flags & QF_GETLIST_NR))
status = dict_add_nr_str(retdict, "nr", qf_idx + 1, NULL);
if ((status == OK) && (flags & QF_GETLIST_WINID))
{
win_T *win;
win = qf_find_win(qi);
if (win != NULL)
status = dict_add_nr_str(retdict, "winid", win->w_id, NULL);
}
return status;
}
/*
* Add list of entries to quickfix/location list. Each list entry is
* a dictionary with item information.
*/
static int
qf_add_entries(
qf_info_T *qi,
list_T *list,
char_u *title,
int action)
{
listitem_T *li;
dict_T *d;
@@ -4613,16 +4705,8 @@ set_errorlist(
#endif
int valid, status;
int retval = OK;
qf_info_T *qi = &ql_info;
int did_bufnr_emsg = FALSE;
if (wp != NULL)
{
qi = ll_get_or_alloc_list(wp);
if (qi == NULL)
return FAIL;
}
if (action == ' ' || qi->qf_curlist == qi->qf_listcount)
/* make place for a new list */
qf_new_list(qi, title);
@@ -4719,6 +4803,74 @@ set_errorlist(
return retval;
}
static int
qf_set_properties(qf_info_T *qi, dict_T *what)
{
dictitem_T *di;
int retval = FAIL;
int qf_idx;
qf_idx = qi->qf_curlist; /* default is the current list */
if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL)
{
/* Use the specified quickfix/location list */
if (di->di_tv.v_type == VAR_NUMBER)
{
qf_idx = di->di_tv.vval.v_number - 1;
if (qf_idx < 0 || qf_idx >= qi->qf_listcount)
return FAIL;
}
else
return FAIL;
}
if ((di = dict_find(what, (char_u *)"title", -1)) != NULL)
{
if (di->di_tv.v_type == VAR_STRING)
{
vim_free(qi->qf_lists[qf_idx].qf_title);
qi->qf_lists[qf_idx].qf_title =
get_dict_string(what, (char_u *)"title", TRUE);
if (qf_idx == qi->qf_curlist)
qf_update_win_titlevar(qi);
retval = OK;
}
}
return retval;
}
/*
* Populate the quickfix list with the items supplied in the list
* of dictionaries. "title" will be copied to w:quickfix_title.
* "action" is 'a' for add, 'r' for replace. Otherwise create a new list.
*/
int
set_errorlist(
win_T *wp,
list_T *list,
int action,
char_u *title,
dict_T *what)
{
qf_info_T *qi = &ql_info;
int retval = OK;
if (wp != NULL)
{
qi = ll_get_or_alloc_list(wp);
if (qi == NULL)
return FAIL;
}
if (what != NULL)
retval = qf_set_properties(qi, what);
else
retval = qf_add_entries(qi, list, title, action);
return retval;
}
#endif
/*
+22 -33
View File
@@ -498,6 +498,7 @@ update_screen(int type)
int did_one;
#endif
#ifdef FEAT_GUI
int did_undraw = FALSE;
int gui_cursor_col;
int gui_cursor_row;
#endif
@@ -697,11 +698,12 @@ update_screen(int type)
/* Remove the cursor before starting to do anything, because
* scrolling may make it difficult to redraw the text under
* it. */
if (gui.in_use)
if (gui.in_use && wp == curwin)
{
gui_cursor_col = gui.cursor_col;
gui_cursor_row = gui.cursor_row;
gui_undraw_cursor();
did_undraw = TRUE;
}
#endif
}
@@ -757,7 +759,7 @@ update_screen(int type)
if (gui.in_use)
{
out_flush(); /* required before updating the cursor */
if (did_one && !gui_mch_is_blink_off())
if (did_undraw && !gui_mch_is_blink_off())
{
/* Put the GUI position where the cursor was, gui_update_cursor()
* uses that. */
@@ -2203,7 +2205,7 @@ win_update(win_T *wp)
/* make sure the rest of the screen is blank */
/* put '~'s on rows that aren't part of the file. */
win_draw_end(wp, '~', ' ', row, wp->w_height, HLF_AT);
win_draw_end(wp, '~', ' ', row, wp->w_height, HLF_EOB);
}
/* Reset the type of redrawing required, the window has been updated. */
@@ -2253,23 +2255,6 @@ win_update(win_T *wp)
#endif
}
#ifdef FEAT_SIGNS
static int draw_signcolumn(win_T *wp);
/*
* Return TRUE when window "wp" has a column to draw signs in.
*/
static int
draw_signcolumn(win_T *wp)
{
return (wp->w_buffer->b_signlist != NULL
# ifdef FEAT_NETBEANS_INTG
|| wp->w_buffer->b_has_sign_column
# endif
);
}
#endif
/*
* Clear the rest of the window and mark the unused lines with "c1". use "c2"
* as the filler character.
@@ -2311,7 +2296,7 @@ win_draw_end(
}
# endif
# ifdef FEAT_SIGNS
if (draw_signcolumn(wp))
if (signcolumn_on(wp))
{
int nn = n + 2;
@@ -2361,7 +2346,7 @@ win_draw_end(
}
#endif
#ifdef FEAT_SIGNS
if (draw_signcolumn(wp))
if (signcolumn_on(wp))
{
int nn = n + 2;
@@ -2505,7 +2490,7 @@ fold_line(
#ifdef FEAT_SIGNS
/* If signs are being displayed, add two spaces. */
if (draw_signcolumn(wp))
if (signcolumn_on(wp))
{
len = W_WIDTH(wp) - col;
if (len > 0)
@@ -3557,6 +3542,7 @@ win_line(
shl->startcol = MAXCOL;
shl->endcol = MAXCOL;
shl->attr_cur = 0;
shl->is_addpos = FALSE;
v = (long)(ptr - line);
if (cur != NULL)
cur->pos.cur = 0;
@@ -3675,7 +3661,7 @@ win_line(
draw_state = WL_SIGN;
/* Show the sign column when there are any signs in this
* buffer or when using Netbeans. */
if (draw_signcolumn(wp))
if (signcolumn_on(wp))
{
int text_sign;
# ifdef FEAT_SIGN_ICONS
@@ -5145,14 +5131,14 @@ win_line(
* needed when a '$' was displayed for 'list'. */
#ifdef FEAT_SEARCH_EXTRA
prevcol_hl_flag = FALSE;
if (prevcol == (long)search_hl.startcol)
if (!search_hl.is_addpos && prevcol == (long)search_hl.startcol)
prevcol_hl_flag = TRUE;
else
{
cur = wp->w_match_head;
while (cur != NULL)
{
if (prevcol == (long)cur->hl.startcol)
if (!cur->hl.is_addpos && prevcol == (long)cur->hl.startcol)
{
prevcol_hl_flag = TRUE;
break;
@@ -5227,7 +5213,8 @@ win_line(
}
else
shl = &cur->hl;
if ((ptr - line) - 1 == (long)shl->startcol)
if ((ptr - line) - 1 == (long)shl->startcol
&& (shl == &search_hl || !shl->is_addpos))
char_attr = shl->attr;
if (shl != &search_hl && cur != NULL)
cur = cur->next;
@@ -7843,6 +7830,7 @@ next_search_hl_pos(
shl->rm.startpos[0].col = start;
shl->rm.endpos[0].lnum = 0;
shl->rm.endpos[0].col = end;
shl->is_addpos = TRUE;
posmatch->cur = bot + 1;
return TRUE;
}
@@ -9707,7 +9695,7 @@ screen_ins_lines(
#ifdef FEAT_GUI
/* Don't update the GUI cursor here, ScreenLines[] is invalid until the
* scrolling is actually carried out. */
gui_dont_update_cursor();
gui_dont_update_cursor(row + off <= gui.cursor_row);
#endif
if (*T_CCS != NUL) /* cursor relative to region */
@@ -9809,10 +9797,10 @@ screen_ins_lines(
}
/*
* delete lines on the screen and update ScreenLines[]
* 'end' is the line after the scrolled part. Normally it is Rows.
* When scrolling region used 'off' is the offset from the top for the region.
* 'row' and 'end' are relative to the start of the region.
* Delete lines on the screen and update ScreenLines[].
* "end" is the line after the scrolled part. Normally it is Rows.
* When scrolling region used "off" is the offset from the top for the region.
* "row" and "end" are relative to the start of the region.
*
* Return OK for success, FAIL if the lines are not deleted.
*/
@@ -9928,7 +9916,8 @@ screen_del_lines(
#ifdef FEAT_GUI
/* Don't update the GUI cursor here, ScreenLines[] is invalid until the
* scrolling is actually carried out. */
gui_dont_update_cursor();
gui_dont_update_cursor(gui.cursor_row >= row + off
&& gui.cursor_row < end + off);
#endif
if (*T_CCS != NUL) /* cursor relative to region */
+6
View File
@@ -263,6 +263,10 @@ typedef struct
int wo_crb_save; /* 'cursorbind' state saved for diff mode*/
# define w_p_crb_save w_onebuf_opt.wo_crb_save
#endif
#ifdef FEAT_SIGNS
char_u *wo_scl;
# define w_p_scl w_onebuf_opt.wo_scl /* 'signcolumn' */
#endif
#ifdef FEAT_EVAL
int wo_scriptID[WV_COUNT]; /* SIDs for window-local options */
@@ -2447,6 +2451,8 @@ typedef struct
linenr_T first_lnum; /* first lnum to search for multi-line pat */
colnr_T startcol; /* in win_line() points to char where HL starts */
colnr_T endcol; /* in win_line() points to char where HL ends */
int is_addpos; /* position specified directly by
matchaddpos(). TRUE/FALSE */
#ifdef FEAT_RELTIME
proftime_T tm; /* for a time limit */
#endif
+2 -1
View File
@@ -6789,6 +6789,7 @@ static char *(highlight_init_both[]) =
"StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"),
CENT("StatusLineNC term=reverse cterm=reverse",
"StatusLineNC term=reverse cterm=reverse gui=reverse"),
"default link EndOfBuffer NonText",
#ifdef FEAT_WINDOWS
CENT("VertSplit term=reverse cterm=reverse",
"VertSplit term=reverse cterm=reverse gui=reverse"),
@@ -7940,7 +7941,7 @@ do_highlight(
*/
for (p = arg, off = 0; off < 100 - 6 && *p; )
{
len = trans_special(&p, buf + off, FALSE);
len = trans_special(&p, buf + off, FALSE, FALSE);
if (len > 0) /* recognized special char */
off += len;
else /* copy as normal char */
+1 -1
View File
@@ -916,7 +916,7 @@ do_tag(
}
vim_snprintf((char *)IObuff, IOSIZE, "ltag %s", tag);
set_errorlist(curwin, list, ' ', IObuff);
set_errorlist(curwin, list, ' ', IObuff, NULL);
list_free(list);
vim_free(fname);
+1 -1
View File
@@ -5435,7 +5435,7 @@ replace_termcodes(
}
#endif
slen = trans_special(&src, result + dlen, TRUE);
slen = trans_special(&src, result + dlen, TRUE, FALSE);
if (slen)
{
dlen += slen;
+1 -1
View File
@@ -98,7 +98,6 @@ SCRIPTS_ALL = \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
test_mapping.out \
test_marks.out \
test_nested_function.out \
test_search_mbyte.out \
@@ -160,6 +159,7 @@ NEW_TESTS = test_arglist.res \
test_assert.res \
test_autochdir \
test_backspace_opt.res \
test_bufwintabinfo.res \
test_cdo.res \
test_channel.res \
test_cmdline.res \
+1
View File
@@ -23,6 +23,7 @@ source test_lambda.vim
source test_lispwords.vim
source test_match.vim
source test_menu.vim
source test_mapping.vim
source test_messages.vim
source test_partial.vim
source test_popup.vim
+85
View File
@@ -0,0 +1,85 @@
" Tests for the getbufinfo(), getwininfo() and gettabinfo() functions
function Test_getbufwintabinfo()
1,$bwipeout
edit Xtestfile1
edit Xtestfile2
let buflist = getbufinfo()
call assert_equal(2, len(buflist))
call assert_match('Xtestfile1', buflist[0].name)
call assert_match('Xtestfile2', getbufinfo('Xtestfile2')[0].name)
call assert_equal([], getbufinfo(2016))
edit Xtestfile1
hide edit Xtestfile2
hide enew
call assert_equal(3, len(getbufinfo({'bufloaded':1})))
set tabstop&vim
let b:editor = 'vim'
let l = getbufinfo('%')
call assert_equal(bufnr('%'), l[0].nr)
call assert_equal(8, l[0].options.tabstop)
call assert_equal('vim', l[0].variables.editor)
call assert_notequal(-1, index(l[0].windows, bufwinid('%')))
if has('signs')
call append(0, ['Linux', 'Windows', 'Mac'])
sign define Mark text=>> texthl=Search
exe "sign place 2 line=3 name=Mark buffer=" . bufnr('%')
let l = getbufinfo('%')
call assert_equal(2, l[0].signs[0].id)
call assert_equal(3, l[0].signs[0].lnum)
call assert_equal('Mark', l[0].signs[0].name)
sign unplace *
sign undefine Mark
enew!
endif
only
let w1_id = win_getid()
new
let w2_id = win_getid()
tabnew | let w3_id = win_getid()
new | let w4_id = win_getid()
new | let w5_id = win_getid()
call setwinvar(0, 'signal', 'green')
tabfirst
let winlist = getwininfo()
call assert_equal(5, len(winlist))
call assert_equal(winbufnr(2), winlist[1].bufnum)
call assert_equal(winheight(2), winlist[1].height)
call assert_equal(1, winlist[2].nr)
if has('signs')
call assert_equal('auto', winlist[0].options.signcolumn)
endif
call assert_equal(2, winlist[3].tpnr)
call assert_equal('green', winlist[2].variables.signal)
call assert_equal(winwidth(1), winlist[0].width)
call assert_equal(w4_id, winlist[3].winid)
let winfo = getwininfo(w5_id)[0]
call assert_equal(2, winfo.tpnr)
call assert_equal([], getwininfo(3))
call settabvar(1, 'space', 'build')
let tablist = gettabinfo()
call assert_equal(2, len(tablist))
call assert_equal(3, len(tablist[1].windows))
call assert_equal(2, tablist[1].nr)
call assert_equal('build', tablist[0].variables.space)
call assert_equal(w2_id, tablist[0].windows[0])
call assert_equal([], gettabinfo(3))
tabonly | only
lexpr ''
lopen
copen
let winlist = getwininfo()
call assert_false(winlist[0].quickfix)
call assert_false(winlist[0].loclist)
call assert_true(winlist[1].quickfix)
call assert_true(winlist[1].loclist)
call assert_true(winlist[2].quickfix)
call assert_false(winlist[2].loclist)
wincmd t | only
endfunction
+4
View File
@@ -94,6 +94,10 @@ func Test_getcompletion()
call assert_true(index(l, 'runtest.vim') >= 0)
let l = getcompletion('walk', 'file')
call assert_equal([], l)
set wildignore=*.vim
let l = getcompletion('run', 'file', 1)
call assert_true(index(l, 'runtest.vim') < 0)
set wildignore&
let l = getcompletion('ha', 'filetype')
call assert_true(index(l, 'hamster') >= 0)
+44
View File
@@ -136,6 +136,50 @@ function Test_printf_64bit()
endif
endfunc
function Test_printf_spec_s()
" number
call assert_equal("1234567890", printf('%s', 1234567890))
" string
call assert_equal("abcdefgi", printf('%s', "abcdefgi"))
" float
if has('float')
call assert_equal("1.23", printf('%s', 1.23))
endif
" list
let value = [1, 'two', ['three', 4]]
call assert_equal(string(value), printf('%s', value))
" dict
let value = {'key1' : 'value1', 'key2' : ['list', 'value'], 'key3' : {'dict' : 'value'}}
call assert_equal(string(value), printf('%s', value))
" funcref
call assert_equal('printf', printf('%s', function('printf')))
" partial
call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s'])))
endfunc
function Test_printf_spec_b()
call assert_equal("0", printf('%b', 0))
call assert_equal("00001100", printf('%08b', 12))
call assert_equal("11111111", printf('%08b', 0xff))
call assert_equal(" 1111011", printf('%10b', 123))
call assert_equal("0001111011", printf('%010b', 123))
call assert_equal(" 0b1111011", printf('%#10b', 123))
call assert_equal("0B01111011", printf('%#010B', 123))
call assert_equal("1001001100101100000001011010010", printf('%b', 1234567890))
if has('num64')
call assert_equal("11100000100100010000110000011011101111101111001", printf('%b', 123456789012345))
call assert_equal("1111111111111111111111111111111111111111111111111111111111111111", printf('%b', -1))
else
call assert_equal("11111111111111111111111111111111", printf('%b', -1))
endif
endfunc
func Test_substitute_expr()
let g:val = 'XXX'
call assert_equal('XXX', substitute('yyy', 'y*', '\=g:val', ''))
-72
View File
@@ -1,72 +0,0 @@
Test for mappings and abbreviations
STARTTEST
:so small.vim
:so mbyte.vim
:set encoding=utf-8
: " abbreviations with р (0x80) should work
:inoreab чкпр vim
GAчкпр

:" mapping of ctrl-c in Insert mode
:set cpo-=< cpo-=k
:inoremap <c-c> <ctrl-c>
:cnoremap <c-c> dummy
:cunmap <c-c>
GA
TEST2: CTRL-C |A|

:unmap <c-c>
:unmap! <c-c>
:"
:" mapping of ctrl-c in Visual mode
:vnoremap <c-c> :<C-u>$put ='vmap works'
GV
:vunmap <c-c>
:"
:" langmap should not get remapped in insert mode
:inoremap { FAIL_ilangmap
:set langmap=+{ langnoremap
o+
:" Insert-mode expr mapping with langmap
:inoremap <expr> { "FAIL_iexplangmap"
o+
:" langmap should not get remapped in Command-line mode
:cnoremap { FAIL_clangmap
:call append(line('$'), '+')
:cunmap {
:" Command-line mode expr mapping with langmap
:cnoremap <expr> { "FAIL_cexplangmap"
:call append(line('$'), '+')
:cunmap {
:"
:" issue #212 (feedkeys insert mapping at current position)
:nnoremap . :call feedkeys(".", "in")<cr>
:/^a b
0qqdw.ifooqj0@q:unmap .
:" <c-g>U<cursor> works only within a single line
:imapclear
:imap ( ()<c-g>U<left>
G2oki
Test1: text with a (here some more textk.
:" test undo
G2oki
Test2: text wit a (here some more text [und undo]uk.u
:"
:imapclear
:set whichwrap=<,>,[,]
G3o2k
:exe ":norm! iTest3: text with a (parenthesis here\<C-G>U\<Right>new line here\<esc>\<up>\<up>."
:/^test/,$w! test.out
:qa!
ENDTEST
test starts here:
a b c d
a b c d
-22
View File
@@ -1,22 +0,0 @@
test starts here:
fooc d
fooc d
vim
TEST2: CTRL-C |<ctrl-c>A|
vmap works
+
+
+
+
Test1: text with a (here some more text)
Test1: text with a (here some more text)
Test2: text wit a (here some more text [und undo])
new line here
Test3: text with a (parenthesis here
new line here
+108
View File
@@ -0,0 +1,108 @@
" Tests for mappings and abbreviations
if !has('multi_byte')
finish
endif
func Test_abbreviation()
" abbreviation with 0x80 should work
inoreab чкпр vim
call feedkeys("Goчкпр \<Esc>", "xt")
call assert_equal('vim ', getline('$'))
iunab чкпр
set nomodified
endfunc
func Test_map_ctrl_c_insert()
" mapping of ctrl-c in Insert mode
set cpo-=< cpo-=k
inoremap <c-c> <ctrl-c>
cnoremap <c-c> dummy
cunmap <c-c>
call feedkeys("GoTEST2: CTRL-C |\<C-C>A|\<Esc>", "xt")
call assert_equal('TEST2: CTRL-C |<ctrl-c>A|', getline('$'))
unmap! <c-c>
set nomodified
endfunc
func Test_map_ctrl_c_visual()
" mapping of ctrl-c in Visual mode
vnoremap <c-c> :<C-u>$put ='vmap works'
call feedkeys("GV\<C-C>\<CR>", "xt")
call assert_equal('vmap works', getline('$'))
vunmap <c-c>
set nomodified
endfunc
func Test_map_langmap()
" langmap should not get remapped in insert mode
inoremap { FAIL_ilangmap
set langmap=+{ langnoremap
call feedkeys("Go+\<Esc>", "xt")
call assert_equal('+', getline('$'))
" Insert-mode expr mapping with langmap
inoremap <expr> { "FAIL_iexplangmap"
call feedkeys("Go+\<Esc>", "xt")
call assert_equal('+', getline('$'))
iunmap <expr> {
" langmap should not get remapped in Command-line mode
cnoremap { FAIL_clangmap
call feedkeys(":call append(line('$'), '+')\<CR>", "xt")
call assert_equal('+', getline('$'))
cunmap {
" Command-line mode expr mapping with langmap
cnoremap <expr> { "FAIL_cexplangmap"
call feedkeys(":call append(line('$'), '+')\<CR>", "xt")
call assert_equal('+', getline('$'))
cunmap {
set nomodified
endfunc
func Test_map_feedkeys()
" issue #212 (feedkeys insert mapping at current position)
nnoremap . :call feedkeys(".", "in")<cr>
call setline('$', ['a b c d', 'a b c d'])
$-1
call feedkeys("0qqdw.ifoo\<Esc>qj0@q\<Esc>", "xt")
call assert_equal(['fooc d', 'fooc d'], getline(line('$') - 1, line('$')))
unmap .
set nomodified
endfunc
func Test_map_cursor()
" <c-g>U<cursor> works only within a single line
imapclear
imap ( ()<c-g>U<left>
call feedkeys("G2o\<Esc>ki\<CR>Test1: text with a (here some more text\<Esc>k.", "xt")
call assert_equal('Test1: text with a (here some more text)', getline(line('$') - 2))
call assert_equal('Test1: text with a (here some more text)', getline(line('$') - 1))
" test undo
call feedkeys("G2o\<Esc>ki\<CR>Test2: text wit a (here some more text [und undo]\<C-G>u\<Esc>k.u", "xt")
call assert_equal('', getline(line('$') - 2))
call assert_equal('Test2: text wit a (here some more text [und undo])', getline(line('$') - 1))
set nomodified
imapclear
endfunc
" This isn't actually testing a mapping, but similar use of CTRL-G U as above.
func Test_break_undo()
:set whichwrap=<,>,[,]
call feedkeys("G4o2k", "xt")
exe ":norm! iTest3: text with a (parenthesis here\<C-G>U\<Right>new line here\<esc>\<up>\<up>."
call assert_equal('new line here', getline(line('$') - 3))
call assert_equal('Test3: text with a (parenthesis here', getline(line('$') - 2))
call assert_equal('new line here', getline(line('$') - 1))
set nomodified
endfunc
func Test_map_meta_quotes()
imap <M-"> foo
call feedkeys("Go-\<M-\">-\<Esc>", "xt")
call assert_equal("-foo-", getline('$'))
set nomodified
iunmap <M-">
endfunc
+25 -1
View File
@@ -1,7 +1,7 @@
" Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(),
" matchaddpos(), matcharg(), matchdelete(), matchstrpos() and setmatches().
function Test_matcharg()
function Test_match()
highlight MyGroup1 term=bold ctermbg=red guibg=red
highlight MyGroup2 term=italic ctermbg=green guibg=green
highlight MyGroup3 term=underline ctermbg=blue guibg=blue
@@ -162,4 +162,28 @@ func Test_matchstrpos()
call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img'))
endfunc
func Test_matchaddpos()
syntax on
set hlsearch
call setline(1, ['12345', 'NP'])
call matchaddpos('Error', [[1,2], [1,6], [2,2]])
redraw!
call assert_notequal(screenattr(2,2), 0)
call assert_equal(screenattr(2,2), screenattr(1,2))
call assert_notequal(screenattr(2,2), screenattr(1,6))
1
call matchadd('Search', 'N\|\n')
redraw!
call assert_notequal(screenattr(2,1), 0)
call assert_equal(screenattr(2,1), screenattr(1,6))
exec "norm! i0\<Esc>"
redraw!
call assert_equal(screenattr(2,2), screenattr(1,6))
nohl
syntax off
set hlsearch&
endfunc
" vim: et ts=2 sw=2
+12 -2
View File
@@ -16,7 +16,7 @@ function! Test_whichwrap()
set whichwrap&
endfunction
function! Test_options()
function Test_options()
let caught = 'ok'
try
options
@@ -29,7 +29,7 @@ function! Test_options()
close
endfunction
function! Test_path_keep_commas()
function Test_path_keep_commas()
" Test that changing 'path' keeps two commas.
set path=foo,,bar
set path-=bar
@@ -38,3 +38,13 @@ function! Test_path_keep_commas()
set path&
endfunction
func Test_signcolumn()
if has('signs')
call assert_equal("auto", &signcolumn)
set signcolumn=yes
set signcolumn=no
call assert_fails('set signcolumn=nope')
endif
endfunc
+39
View File
@@ -1505,3 +1505,42 @@ func Test_duplicate_buf()
call delete('Xgrepthis')
endfunc
" Quickfix/Location list set/get properties tests
function Xproperty_tests(cchar)
call s:setup_commands(a:cchar)
" Error cases
call assert_fails('call g:Xgetlist(99)', 'E715:')
call assert_fails('call g:Xsetlist(99)', 'E714:')
call assert_fails('call g:Xsetlist([], "a", [])', 'E715:')
" Set and get the title
Xopen
wincmd p
call g:Xsetlist([{'filename':'foo', 'lnum':27}])
call g:Xsetlist([], 'a', {'title' : 'Sample'})
let d = g:Xgetlist({"title":1})
call assert_equal('Sample', d.title)
Xopen
call assert_equal('Sample', w:quickfix_title)
Xclose
" Invalid arguments
call assert_fails('call g:Xgetlist([])', 'E715')
call assert_fails('call g:Xsetlist([], "a", [])', 'E715')
let s = g:Xsetlist([], 'a', {'abc':1})
call assert_equal(-1, s)
call assert_equal({}, g:Xgetlist({'abc':1}))
if a:cchar == 'l'
call assert_equal({}, getloclist(99, ['title']))
endif
endfunction
function Test_qf_property()
call Xproperty_tests('c')
call Xproperty_tests('l')
endfunction
+9
View File
@@ -30,3 +30,12 @@ func Test_equivalence_re2()
set re=2
call s:equivalence_test()
endfunc
func Test_recursive_substitute()
new
s/^/\=execute("s#^##gn")
" check we are now not in the sandbox
call setwinvar(1, 'myvar', 1)
bwipe!
endfunc
+19
View File
@@ -25,11 +25,13 @@ endfunc
func Test_equivalence_re1()
set re=1
call s:equivalence_test()
set re=0
endfunc
func Test_equivalence_re2()
set re=2
call s:equivalence_test()
set re=0
endfunc
func s:classes_test()
@@ -82,9 +84,26 @@ endfunc
func Test_classes_re1()
set re=1
call s:classes_test()
set re=0
endfunc
func Test_classes_re2()
set re=2
call s:classes_test()
set re=0
endfunc
func Test_source_utf8()
" check that sourcing a script with 0x80 as second byte works
new
call setline(1, [':%s/àx/--à1234--/g', ':%s/Àx/--À1234--/g'])
write! Xscript
bwipe!
new
call setline(1, [' àx ', ' Àx '])
source! Xscript | echo
call assert_equal(' --à1234-- ', getline(1))
call assert_equal(' --À1234-- ', getline(2))
bwipe!
call delete('Xscript')
endfunc
+30
View File
@@ -425,3 +425,33 @@ func Test_viminfo_file_marks()
call delete('Xviminfo')
endfunc
func Test_viminfo_file_mark_tabclose()
tabnew Xtestfileintab
call setline(1, ['a','b','c','d','e'])
4
q!
wviminfo Xviminfo
sp Xviminfo
/^> .*Xtestfileintab
let lnum = line('.')
while 1
if lnum == line('$')
call assert_false(1, 'mark not found in Xtestfileintab')
break
endif
let lnum += 1
let line = getline(lnum)
if line == ''
call assert_false(1, 'mark not found in Xtestfileintab')
break
endif
if line =~ "^\t\""
call assert_equal('4', substitute(line, ".*\"\t\\(\\d\\).*", '\1', ''))
break
endif
endwhile
call delete('Xviminfo')
silent! bwipe Xtestfileintab
endfunc
+61 -13
View File
@@ -739,6 +739,19 @@ static char *(features[]) =
#else
"-xim",
#endif
#ifdef WIN3264
# ifdef FEAT_XPM_W32
"+xpm_w32",
# else
"-xpm_w32",
# endif
#else
# ifdef HAVE_XPM
"+xpm",
# else
"-xpm",
# endif
#endif
#if defined(UNIX) || defined(VMS)
# ifdef USE_XSMP_INTERACT
"+xsmp_interact",
@@ -759,25 +772,60 @@ static char *(features[]) =
"+xterm_save",
#else
"-xterm_save",
#endif
#ifdef WIN3264
# ifdef FEAT_XPM_W32
"+xpm_w32",
# else
"-xpm_w32",
# endif
#else
# ifdef HAVE_XPM
"+xpm",
# else
"-xpm",
# endif
#endif
NULL
};
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2222,
/**/
2221,
/**/
2220,
/**/
2219,
/**/
2218,
/**/
2217,
/**/
2216,
/**/
2215,
/**/
2214,
/**/
2213,
/**/
2212,
/**/
2211,
/**/
2210,
/**/
2209,
/**/
2208,
/**/
2207,
/**/
2206,
/**/
2205,
/**/
2204,
/**/
2203,
/**/
2202,
/**/
2201,
/**/
2200,
/**/
2199,
/**/
2198,
/**/
+3 -2
View File
@@ -1366,7 +1366,8 @@ typedef enum
{
HLF_8 = 0 /* Meta & special keys listed with ":map", text that is
displayed different from what it is */
, HLF_AT /* @ and ~ characters at end of screen, characters that
, HLF_EOB /* after the last line in the buffer */
, HLF_AT /* @ characters at end of screen, characters that
don't really exist in the text */
, HLF_D /* directories in CTRL-D listing */
, HLF_E /* error messages */
@@ -1413,7 +1414,7 @@ typedef enum
/* The HL_FLAGS must be in the same order as the HLF_ enums!
* When changing this also adjust the default for 'highlight'. */
#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
#define HL_FLAGS {'8', '~', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
'n', 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
'f', 'F', 'A', 'C', 'D', 'T', '-', '>', \
'B', 'P', 'R', 'L', \
+37 -1
View File
@@ -1363,7 +1363,7 @@ win_init_some(win_T *newp, win_T *oldp)
#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Check if "win" is a pointer to an existing window.
* Check if "win" is a pointer to an existing window in the current tab page.
*/
int
win_valid(win_T *win)
@@ -1378,6 +1378,28 @@ win_valid(win_T *win)
return FALSE;
}
/*
* Check if "win" is a pointer to an existing window in any tab page.
*/
int
win_valid_any_tab(win_T *win)
{
win_T *wp;
tabpage_T *tp;
if (win == NULL)
return FALSE;
FOR_ALL_TABPAGES(tp)
{
FOR_ALL_WINDOWS_IN_TAB(tp, wp)
{
if (wp == win)
return TRUE;
}
}
return FALSE;
}
/*
* Return the number of windows.
*/
@@ -7160,6 +7182,20 @@ win_id2tabwin(typval_T *argvars, list_T *list)
list_append_number(list, 0);
}
win_T *
win_id2wp(typval_T *argvars)
{
win_T *wp;
tabpage_T *tp;
int id = get_tv_number(&argvars[0]);
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_id == id)
return wp;
return NULL;
}
int
win_id2win(typval_T *argvars)
{