Merge remote-tracking branch 'vim/master'

This commit is contained in:
Yee Cheng Chin
2019-02-23 01:28:22 -08:00
50 changed files with 1918 additions and 578 deletions
+2
View File
@@ -379,6 +379,8 @@ Section "$(str_section_exe)" id_section_exe
File ${VIMRT}\pack\dist\opt\matchit\doc\*.*
SetOutPath $0\pack\dist\opt\matchit\plugin
File ${VIMRT}\pack\dist\opt\matchit\plugin\*.*
SetOutPath $0\pack\dist\opt\matchit\autoload
File ${VIMRT}\pack\dist\opt\matchit\autoload\*.*
SetOutPath $0\pack\dist\opt\shellmenu\plugin
File ${VIMRT}\pack\dist\opt\shellmenu\plugin\*.*
+5 -5
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.1. Last change: 2019 Feb 16
*eval.txt* For Vim version 8.1. Last change: 2019 Feb 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2893,9 +2893,9 @@ assert_false({actual} [, {msg}]) *assert_false()*
"Expected False but got {actual}" is produced.
assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
This asserts number values. When {actual} is lower than
{lower} or higher than {upper} an error message is added to
|v:errors|. Also see |assert-return|.
This asserts number and |Float| values. When {actual} is lower
than {lower} or higher than {upper} an error message is added
to |v:errors|. Also see |assert-return|.
When {msg} is omitted an error in the form
"Expected range {lower} - {upper}, but got {actual}" is
produced.
@@ -5151,7 +5151,7 @@ gettabinfo([{arg}]) *gettabinfo()*
tabnr tab page number.
variables a reference to the dictionary with
tabpage-local variables
windows List of |window-ID|s in the tag page.
windows List of |window-ID|s in the tab page.
gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()*
Get the value of a tab-local variable {varname} in tab page
+6 -1
View File
@@ -1,4 +1,4 @@
*indent.txt* For Vim version 8.1. Last change: 2019 Jan 31
*indent.txt* For Vim version 8.1. Last change: 2019 Feb 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -948,6 +948,11 @@ can sometimes be slow, thus it timeouts after 150 msec. If you notice the
indenting isn't correct, you can set a larger timeout in msec: >
let g:pyindent_searchpair_timeout = 500
If looking back for unclosed parenthesis is still too slow, especially during
a copy-paste operation, or if you don't need indenting inside multi-line
parentheses, you can completely disable this feature: >
let g:pyindent_disable_parentheses_indenting = 1
R *ft-r-indent*
+48 -3
View File
@@ -1,4 +1,4 @@
*index.txt* For Vim version 8.1. Last change: 2019 Jan 17
*index.txt* For Vim version 8.1. Last change: 2019 Feb 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -17,9 +17,11 @@ to look for deleting something, use: "/delete".
2.3. Square bracket commands |[|
2.4. Commands starting with 'g' |g|
2.5. Commands starting with 'z' |z|
2.6. Operator-pending mode |operator-pending-index|
3. Visual mode |visual-index|
4. Command-line editing |ex-edit-index|
5. EX commands |ex-cmd-index|
5. Terminal-Job mode |terminal-job-index|
6. EX commands |ex-cmd-index|
For an overview of options see help.txt |option-list|.
For an overview of built-in functions see |functions|.
@@ -166,6 +168,20 @@ commands in CTRL-X submode *i_CTRL-X_index*
|i_CTRL-X_s| CTRL-X s spelling suggestions
{not available when compiled without the |+insert_expand| feature}
commands in completion mode (see |popupmenu-keys|)
|complete_CTRL-E| CTRL-E stop completion and go back to original text
|complete_CTRL-Y| CTRL-Y accept selected match and stop completion
CTRL-L insert one character from the current match
<CR> insert currently selected match
<BS> delete one character and redo search
CTRL-H same as <BS>
<Up> select the previous match
<Down> select the next match
<PageUp> select a match several entries back
<PageDown> select a match several entries forward
other stop completion and insert the typed character
==============================================================================
2. Normal mode *normal-index*
@@ -854,6 +870,17 @@ tag char note action in Normal mode ~
|z<Left>| z<Left> same as "zh"
|z<Right>| z<Right> same as "zl"
==============================================================================
2.6 Operator-pending mode *operator-pending-index*
These can be used after an operator, but before a {motion} has been entered.
tag char action in Insert mode ~
-----------------------------------------------------------------------
|o_v| v force operator to work characterwise
|o_V| V force operator to work linewise
|o_CTRL-V| CTRL-V force operator to work blockwise
==============================================================================
3. Visual mode *visual-index*
@@ -1066,10 +1093,28 @@ tag command action in Command-line editing mode ~
|c_<Insert>| <Insert> toggle insert/overstrike mode
|c_<LeftMouse>| <LeftMouse> cursor at mouse click
==============================================================================
5. Terminal-Job mode *terminal-job-index*
Most Normal mode commands except for window commands (|CTRL-W|) do not work in
a terminal window. Switch to Terminal-Normal mode to use them.
This assumes 'termwinkey' is not set.
tag char action in Insert mode ~
-----------------------------------------------------------------------
|t_CTRL-\_CTRL-N| CTRL-\ CTRL-N switch to Terminal-Normal mode
|CTRL-W_N| CTRL-W N switch to Terminal-Normal mode
|CTRL-W_:| CTRL-W : enter an Ex command
|CTRL-W_.| CTRL-W . type CTRL-W in the terminal
CTRL-W CTRL-\ send a CTRL-\ to the job in the terminal
|CTRL-W_quote| CTRL-W " {0-9a-z"%#*:=}
paste register in the terminal
|t_CTRL-W_CTRL-C| CTRL-W CTRL-C forcefully ends the job
You found it, Arthur! *holy-grail* *:smile*
==============================================================================
5. EX commands *ex-cmd-index* *:index*
6. EX commands *ex-cmd-index* *:index*
This is a brief but complete listing of all the ":" commands, without
mentioning any arguments. The optional part of the command name is inside [].
+7 -3
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.1. Last change: 2019 Feb 16
*options.txt* For Vim version 8.1. Last change: 2019 Feb 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2643,6 +2643,9 @@ A jump table for the options with a short description can be found at |Q_op|.
context:{n} Use a context of {n} lines between a change
and a fold that contains unchanged lines.
When omitted a context of six lines is used.
When using zero the context is actually one,
since folds require a line in between, also
for a deleted line.
See |fold-diff|.
iblank Ignore changes where lines are all blank. Adds
@@ -5658,8 +5661,9 @@ A jump table for the options with a short description can be found at |Q_op|.
The 'mousemodel' option is set by the |:behave| command.
*'mouseshape'* *'mouses'* *E547*
'mouseshape' 'mouses' string (default "i:beam,r:beam,s:updown,sd:cross,
m:no,ml:up-arrow,v:rightup-arrow")
'mouseshape' 'mouses' string (default "i-r:beam,s:updown,sd:udsizing,
vs:leftright,vd:lrsizing,m:no,
ml:up-arrow,v:rightup-arrow")
global
{not in Vi}
{only available when compiled with the |+mouseshape|
+2 -2
View File
@@ -1,4 +1,4 @@
*pattern.txt* For Vim version 8.1. Last change: 2018 Dec 26
*pattern.txt* For Vim version 8.1. Last change: 2019 Feb 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1211,7 +1211,7 @@ x A single character, with no special meaning, matches itself
\%u20AC Matches the character specified with up to four hexadecimal
characters.
\%U1234abcd Matches the character specified with up to eight hexadecimal
characters.
characters, up to 0x7fffffff
==============================================================================
7. Ignoring case in a pattern */ignorecase*
+2
View File
@@ -8115,6 +8115,7 @@ omni-sql-completion ft_sql.txt /*omni-sql-completion*
online-help helphelp.txt /*online-help*
opening-window windows.txt /*opening-window*
operator motion.txt /*operator*
operator-pending-index index.txt /*operator-pending-index*
operator-variable eval.txt /*operator-variable*
option-backslash options.txt /*option-backslash*
option-list quickref.txt /*option-list*
@@ -9282,6 +9283,7 @@ terminal-diffscreendump terminal.txt /*terminal-diffscreendump*
terminal-dumptest terminal.txt /*terminal-dumptest*
terminal-functions usr_41.txt /*terminal-functions*
terminal-info term.txt /*terminal-info*
terminal-job-index index.txt /*terminal-job-index*
terminal-key-codes term.txt /*terminal-key-codes*
terminal-ms-windows terminal.txt /*terminal-ms-windows*
terminal-options term.txt /*terminal-options*
+3 -1
View File
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.1. Last change: 2019 Feb 16
*terminal.txt* For Vim version 8.1. Last change: 2019 Feb 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -80,6 +80,8 @@ Special in the terminal window: *CTRL-W_.* *CTRL-W_N*
Also works with the = register to insert the result of
evaluating an expression.
CTRL-W CTRL-C ends the job, see below |t_CTRL-W_CTRL-C|
CTRL-W gt go to next tabpage, same as `gt`
CTRL-W gT go to previous tabpage, same as `gT`
See option 'termwinkey' for specifying another key instead of CTRL-W that
will work like CTRL-W. However, typing 'termwinkey' twice sends 'termwinkey'
+43 -8
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.1. Last change: 2019 Feb 17
*todo.txt* For Vim version 8.1. Last change: 2019 Feb 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,6 +38,8 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
Check https://github.com/macvim-dev/macvim/issues/861.
>
Patch to add farsi handling to arabic.c (Ali Gholami Rudi, 2009 May 2)
Added test, updates, June 23.
Updated for 7.4: http://litcave.rudi.ir/farsi_vim.diff
@@ -131,7 +133,7 @@ Include part of #3242?
Improvement for :terminal winpty/conpty option. Ozaki Kiichi, #3905
Patch to change WIN32 macro names. (Hirohito Higashi, #3932)
Patch to avoid compiler warnings. (Yasuhiro Matsumoto, #3979)
When a terminal exit_cb closes the window, a following typed key is lost, if
it's in a mapping. (2018 Oct 6, #2302, #3522)
@@ -145,11 +147,16 @@ Should do current file first and not split it up when more results are found.
Internal diff doesn't handle binary file like external diff does. (Mike
Williams, 2018 Oct 30)
Patch to fix that dosinstall still has buffer overflow problems. (Yasuhiro
Matsumoto, #4002)
Problem with :tlmenu: Detach item added with all modes? Issue #3563.
Patch to reduce amount of memory used by functions that keep reference.
(ichizok, #3961)
Patch to use wide font functions. (Ken Takata, 2019 Feb 18, #4000)
When using a timer callback vgetc_busy is reset, allowing for using input().
But in a channel callback this does not happen. We need to do something
similar to check_due_timer(). Also see #3809.
@@ -160,6 +167,9 @@ C syntax: {} inside () causes following {} to be highlighted as error.
Support setting the character displayed below the last line? Neovim uses
"eob:X" in 'fillchars'.
Check: __attribute__((format(printf, on semsg() and siemsg(). Where was this
added?
Make balloon_show() work outside of 'balloonexpr'? Users expect it to work:
#2948. (related to #1512?)
On Win32 it stops showing, because showState is already ShS_SHOWING.
@@ -171,14 +181,34 @@ balloonexpr() on MS-Windows GUI doesn't handle accented chars? (nivaemail,
2018 Sep 14)
Another request: #3811.
Height of quickfix window is not retained with vertical splits. (Lifepillar,
2018 Aug 24, #2998)
Patch on the issue by Hongbo Liu, 2019 Feb 19 #4013
More warnings from static analysis:
https://lgtm.com/projects/g/vim/vim/alerts/?mode=list
Still a E315 error when using terminal. (Masato Nishihata, #3959)
When using 'k' in 'guioptions' gvim may open with a tiny window. (#3808)
Suggested patch on the issue.
nvo-mode mapping works on Windows, not on Linux. (#3678)
Patch to fix modify_fname() does not work well with some 'encoding's.
(Ken Takata, #4007)
Patch to make vim_getenv() work with wide API. (Ken Takata, #4008)
Patch to add equal field to complete items. (#3887)
When using exclusive selection and vi" that fails, cursor moves to the left.
Cursor should not move. (#4024)
Patch to fix that executable() may fail on very long filename in MS-Windows.
(Ken Takata, 2016 Feb 1, update 2018 Oct 7, update 2019 Feb 19)
Now in pull request #4015.
Patch to be able to separately map CTRL-H and BS on Windows.
(Linwei, 2017 Jul 11, #1833)
@@ -186,6 +216,8 @@ Patch to fix encoding of messages on MS-Windows. (Yasuhiro Matsumoto, 2019 Feb
13, #3914)
Patch to fix encoding conversion in messages. (#3969)
Check that this is fixed: (ichizok)
vim --clean -X -V1 -es -c 'echo "hello"' -c quit
Incsearch test fails when locale is "C". (Dominique Pelle, #3986)
Also run all tests with C locale?
@@ -210,11 +242,14 @@ https://github.com/chrisbra/vim-mq-patches/blob/master/tagfunc
Updated by Andy Massimino, 2018 Feb 7:
https://github.com/andymass/vim/commit/4e3aa0a5dab96d2799567622f3f537e357aa479e
Or should we make it asynchronous?
Patch by Andy Massimino: #4010 - needs a bit more work
When 'confirm' is set a "silent q" doesn't show the prompt. It should in this
case. (Nate Peterson, 2019 Jan 31, #3892)
For "silent! q" it should not prompt and just fail.
Patch to add readdir(). (Yasuhiro Matsumoto, #2439)
Using CTRL-L to add a character to the search string doesn't work for the last
character in the file. (Smylers, 2018 Nov 17, #3620)
Suggested patch by Hirohito Higashi, 2018 Nov 18.
@@ -277,6 +312,8 @@ Patch to add environ(), gets a dict with all environment vars, and getenv(),
useful for environment vars that are not made of keyword chars.
(Yasuhiro Matsumoto, #2875)
Add buffer argument to undotree(). (#4001)
Patch to add optional arguments with default values.
(Andy Massimino, #3952) under development
@@ -405,9 +442,6 @@ Lemonboy can reproduce (2017 Jun 5)
Also reproduced by Benjamin Doherty, 2018 Oct 4.
Simpler way: Ken Takata, Oct 6.
Height of quickfix window is not retained with vertical splits. (Lifepillar,
2018 Aug 24, #2998)
Window size is wrong when using quickfix window. (Lifepillar, 2018 Aug 24,
#2999)
@@ -423,9 +457,6 @@ is cleared, to avoid going back to the list of errors buffer (would have two
windows with it). Can we just remove the jump list entries for the quickfix
buffer?
Patch to fix that executable() may fail on very long filename in MS-Windows.
(Ken Takata, 2016 Feb 1, update 2018 Oct 7)
Patch to be able to use hex numbers with :digraph. (Lcd, 2015 Sep 6)
Update Sep 7. Update by Christian Brabandt, 2015 Sep 8, 2016 Feb 1.
Patch to be able to disable default digraphs (incomplete) (Eric Pruitt, 2018
@@ -1004,6 +1035,10 @@ sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
Although user could use "xterm -e 'cmd arg'".
Regexp problems:
- NFA engine can be slow for some patterns. Dominique found out that most
time is spent in addstate_here() copying the threads. Instead of copying,
let each thread point to the next one (by offset, the list is reallocated).
(Dominique Pelle, 2019 Feb 18)
- When search pattern has the base character both with and without combining
character, search fails. E.g. "รรีบ" in "การรีบรักใคร". (agguser, #2312)
- [:space:] only matches ASCII spaces. Add [:white:] for all space-like
+3 -1
View File
@@ -1,4 +1,4 @@
*visual.txt* For Vim version 8.1. Last change: 2019 Jan 11
*visual.txt* For Vim version 8.1. Last change: 2019 Feb 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -118,6 +118,8 @@ gn Search forward for the last used search pattern, like
E.g., "dgn" deletes the text of the next match.
If Visual mode is active, extends the selection
until the end of the next match.
Note: Unlinke `n` the search direction does not depend
on the previous search command.
*gN* *v_gN*
gN Like |gn| but searches backward, like with `N`.
+56 -46
View File
@@ -2,7 +2,7 @@
" Language: Python
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Original Author: David Bustos <bustos@caltech.edu>
" Last Change: 2013 Jul 9
" Last Change: 2019 Feb 21
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -53,58 +53,68 @@ function GetPythonIndent(lnum)
return 0
endif
" searchpair() can be slow sometimes, limit the time to 100 msec or what is
" put in g:pyindent_searchpair_timeout
let searchpair_stopline = 0
let searchpair_timeout = get(g:, 'pyindent_searchpair_timeout', 150)
" If the previous line is inside parenthesis, use the indent of the starting
" line.
" Trick: use the non-existing "dummy" variable to break out of the loop when
" going too far back.
call cursor(plnum, 1)
let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
\ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
\ searchpair_stopline, searchpair_timeout)
if parlnum > 0
let plindent = indent(parlnum)
let plnumstart = parlnum
else
" Identing inside parentheses can be very slow, regardless of the searchpair()
" timeout, so let the user disable this feature if he doesn't need it
let disable_parentheses_indenting = get(g:, "pyindent_disable_parentheses_indenting", 0)
if disable_parentheses_indenting == 1
let plindent = indent(plnum)
let plnumstart = plnum
endif
else
" searchpair() can be slow sometimes, limit the time to 150 msec or what is
" put in g:pyindent_searchpair_timeout
let searchpair_stopline = 0
let searchpair_timeout = get(g:, 'pyindent_searchpair_timeout', 150)
" If the previous line is inside parenthesis, use the indent of the starting
" line.
" Trick: use the non-existing "dummy" variable to break out of the loop when
" going too far back.
let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
\ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
\ searchpair_stopline, searchpair_timeout)
if parlnum > 0
let plindent = indent(parlnum)
let plnumstart = parlnum
else
let plindent = indent(plnum)
let plnumstart = plnum
endif
" When inside parenthesis: If at the first line below the parenthesis add
" two 'shiftwidth', otherwise same as previous line.
" i = (a
" + b
" + c)
call cursor(a:lnum, 1)
let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
\ searchpair_stopline, searchpair_timeout)
if p > 0
if p == plnum
" When the start is inside parenthesis, only indent one 'shiftwidth'.
let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
\ searchpair_stopline, searchpair_timeout)
if pp > 0
return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
" When inside parenthesis: If at the first line below the parenthesis add
" two 'shiftwidth', otherwise same as previous line.
" i = (a
" + b
" + c)
call cursor(a:lnum, 1)
let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
\ searchpair_stopline, searchpair_timeout)
if p > 0
if p == plnum
" When the start is inside parenthesis, only indent one 'shiftwidth'.
let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
\ searchpair_stopline, searchpair_timeout)
if pp > 0
return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
endif
return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 2))
endif
return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 2))
if plnumstart == p
return indent(plnum)
endif
return plindent
endif
if plnumstart == p
return indent(plnum)
endif
return plindent
endif
+1 -1
View File
@@ -932,7 +932,7 @@ ifeq (yes, $(USE_STDCPLUS))
LINK = $(CXX)
ifeq (yes, $(STATIC_STDCPLUS))
#LIB += -static-libstdc++ -static-libgcc
LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
LIB += -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
endif
else
LINK = $(CC)
+11 -13
View File
@@ -191,7 +191,7 @@ ch_log_lead(const char *what, channel_T *ch, ch_part_T part)
static int did_log_msg = TRUE;
#ifndef PROTO /* prototype is in vim.h */
#ifndef PROTO // prototype is in proto.h
void
ch_log(channel_T *ch, const char *fmt, ...)
{
@@ -4390,20 +4390,25 @@ channel_parse_messages(void)
{
channel->ch_to_be_closed = (1U << PART_COUNT);
channel_close_now(channel);
/* channel may have been freed, start over */
// channel may have been freed, start over
channel = first_channel;
continue;
}
if (channel->ch_to_be_freed || channel->ch_killing)
{
if (channel->ch_killing)
{
channel_free_contents(channel);
channel->ch_job->jv_channel = NULL;
}
channel_free(channel);
/* channel has been freed, start over */
// channel has been freed, start over
channel = first_channel;
continue;
}
if (channel->ch_refcount == 0 && !channel_still_useful(channel))
{
/* channel is no longer useful, free it */
// channel is no longer useful, free it
channel_free(channel);
channel = first_channel;
part = PART_SOCK;
@@ -5529,15 +5534,8 @@ job_cleanup(job_T *job)
channel_need_redraw = TRUE;
}
if (job->jv_channel != NULL
&& job->jv_channel->ch_anonymous_pipe && !job->jv_channel->ch_killing)
{
++safe_to_invoke_callback;
channel_free_contents(job->jv_channel);
job->jv_channel->ch_job = NULL;
job->jv_channel = NULL;
--safe_to_invoke_callback;
}
if (job->jv_channel != NULL && job->jv_channel->ch_anonymous_pipe)
job->jv_channel->ch_killing = TRUE;
// Do not free the job in case the close callback of the associated channel
// isn't invoked yet and may get information by job_info().
+1 -1
View File
@@ -2277,7 +2277,7 @@ diffopt_changed(void)
tp->tp_diff_invalid = TRUE;
diff_flags = diff_flags_new;
diff_context = diff_context_new;
diff_context = diff_context_new == 0 ? 1 : diff_context_new;
diff_foldcolumn = diff_foldcolumn_new;
diff_algorithm = diff_algorithm_new;
+27 -23
View File
@@ -388,7 +388,7 @@ get_vim_env(void)
/* First get $VIMRUNTIME. If it's set, remove the tail. */
vim = getenv("VIMRUNTIME");
if (vim != NULL && *vim != 0 && strlen(vim) < BUFSIZE)
if (vim != NULL && *vim != 0 && strlen(vim) < sizeof(buf))
{
strcpy(buf, vim);
remove_tail(buf);
@@ -411,7 +411,7 @@ get_vim_env(void)
/* NSIS also uses GetTempPath(), thus we should get the same directory
* name as where NSIS will look for vimini.ini. */
GetTempPath(BUFSIZE, fname);
GetTempPath(sizeof(fname) - 12, fname);
add_pathsep(fname);
strcat(fname, "vimini.ini");
@@ -505,8 +505,8 @@ uninstall_check(int skip_question)
HKEY uninstall_key_handle;
char *uninstall_key = "software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
char subkey_name_buff[BUFSIZE];
char temp_string_buffer[BUFSIZE];
DWORD local_bufsize = BUFSIZE;
char temp_string_buffer[BUFSIZE-2];
DWORD local_bufsize;
FILETIME temp_pfiletime;
DWORD key_index;
char input;
@@ -521,12 +521,14 @@ uninstall_check(int skip_question)
KEY_WOW64_64KEY | KEY_READ, &key_handle);
CHECK_REG_ERROR(code);
for (key_index = 0;
RegEnumKeyEx(key_handle, key_index, subkey_name_buff, &local_bufsize,
NULL, NULL, NULL, &temp_pfiletime) != ERROR_NO_MORE_ITEMS;
key_index++)
key_index = 0;
while (TRUE)
{
local_bufsize = BUFSIZE;
local_bufsize = sizeof(subkey_name_buff);
if (RegEnumKeyEx(key_handle, key_index, subkey_name_buff, &local_bufsize,
NULL, NULL, NULL, &temp_pfiletime) == ERROR_NO_MORE_ITEMS)
break;
if (strncmp("Vim", subkey_name_buff, 3) == 0)
{
/* Open the key named Vim* */
@@ -535,10 +537,10 @@ uninstall_check(int skip_question)
CHECK_REG_ERROR(code);
/* get the DisplayName out of it to show the user */
local_bufsize = sizeof(temp_string_buffer);
code = RegQueryValueEx(uninstall_key_handle, "displayname", 0,
&value_type, (LPBYTE)temp_string_buffer,
&local_bufsize);
local_bufsize = BUFSIZE;
CHECK_REG_ERROR(code);
allow_silent = 0;
@@ -568,9 +570,9 @@ uninstall_check(int skip_question)
fflush(stdout);
/* get the UninstallString */
local_bufsize = sizeof(temp_string_buffer);
code = RegQueryValueEx(uninstall_key_handle, "uninstallstring", 0,
&value_type, (LPBYTE)temp_string_buffer, &local_bufsize);
local_bufsize = BUFSIZE;
CHECK_REG_ERROR(code);
/* Remember the directory, it is used as the default for NSIS. */
@@ -683,6 +685,8 @@ uninstall_check(int skip_question)
RegCloseKey(uninstall_key_handle);
}
key_index++;
}
RegCloseKey(key_handle);
@@ -1614,7 +1618,7 @@ install_registry(void)
const char *vim_ext_ThreadingModel = "Apartment";
const char *vim_ext_name = "Vim Shell Extension";
const char *vim_ext_clsid = "{51EEE242-AD87-11d3-9C1E-0090278BBD99}";
char vim_exe_path[BUFSIZE];
char vim_exe_path[MAX_PATH];
char display_name[BUFSIZE];
char uninstall_string[BUFSIZE];
char icon_string[BUFSIZE];
@@ -1826,7 +1830,7 @@ create_shortcut(
/* translate the (possibly) multibyte shortcut filename to windows
* Unicode so it can be used as a file name.
*/
MultiByteToWideChar(CP_ACP, 0, shortcut_name, -1, wsz, BUFSIZE);
MultiByteToWideChar(CP_ACP, 0, shortcut_name, -1, wsz, sizeof(wsz)/sizeof(wsz[0]));
/* set the attributes */
shelllink_ptr->lpVtbl->SetPath(shelllink_ptr, shortcut_target);
@@ -1869,7 +1873,7 @@ build_link_name(
const char *link_name,
const char *shell_folder_name)
{
char shell_folder_path[BUFSIZE];
char shell_folder_path[MAX_PATH];
if (get_shell_folder_path(shell_folder_path, shell_folder_name) == FAIL)
{
@@ -2135,7 +2139,7 @@ install_OLE_register(void)
* result in "to[]".
*/
static void
dir_remove_last(const char *path, char to[BUFSIZE])
dir_remove_last(const char *path, char to[MAX_PATH])
{
char c;
long last_char_to_copy;
@@ -2206,7 +2210,7 @@ init_homedir(void)
if (homepath == NULL || *homepath == NUL)
homepath = "\\";
if (homedrive != NULL
&& strlen(homedrive) + strlen(homepath) < MAX_PATH)
&& strlen(homedrive) + strlen(homepath) < sizeof(buf))
{
sprintf(buf, "%s%s", homedrive, homepath);
if (buf[0] != NUL)
@@ -2234,10 +2238,9 @@ init_homedir(void)
buf[p - (var + 1)] = NUL;
exp = getenv(buf);
if (exp != NULL && *exp != NUL
&& strlen(exp) + strlen(p) < MAX_PATH)
&& strlen(exp) + strlen(p) < sizeof(buf))
{
_snprintf(buf, MAX_PATH, "%s%s", exp, p + 1);
buf[MAX_PATH - 1] = NUL;
sprintf(buf, "%s%s", exp, p + 1);
var = buf;
}
}
@@ -2278,8 +2281,8 @@ install_vimfilesdir(int idx)
int i;
int vimfiles_dir_choice = choices[idx].arg;
char *p;
char vimdir_path[BUFSIZE];
char vimfiles_path[BUFSIZE];
char vimdir_path[MAX_PATH];
char vimfiles_path[MAX_PATH + 9];
char tmp_dirname[BUFSIZE];
/* switch on the location that the user wants the plugin directories
@@ -2351,10 +2354,11 @@ init_directories_choice(void)
// Check if the "compiler" directory already exists. That's a good
// indication that the plugin directories were already created.
if (getenv("HOME") != NULL)
p = getenv("HOME");
if (p != NULL)
{
vimfiles_dir_choice = (int)vimfiles_dir_home;
sprintf(tmp_dirname, "%s\\vimfiles\\compiler", getenv("HOME"));
sprintf(tmp_dirname, "%s\\vimfiles\\compiler", p);
if (stat(tmp_dirname, &st) == 0)
vimfiles_dir_choice = (int)vimfiles_dir_none;
}
+8 -8
View File
@@ -59,7 +59,7 @@ char *searchpath(char *name);
/* ---------------------------------------- */
#define BUFSIZE 512 /* long enough to hold a file name path */
#define BUFSIZE (MAX_PATH*2) /* long enough to hold a file name path */
#define NUL 0
#define FAIL 0
@@ -93,15 +93,15 @@ int interactive; /* non-zero when running interactively */
static void *
alloc(int len)
{
char *s;
void *p;
s = malloc(len);
if (s == NULL)
p = malloc(len);
if (p == NULL)
{
printf("ERROR: out of memory\n");
exit(1);
}
return (void *)s;
return p;
}
/*
@@ -388,7 +388,7 @@ char *(icon_link_names[ICON_COUNT]) =
run_command(char *cmd)
{
char *cmd_path;
char cmd_buf[BUFSIZE];
char cmd_buf[BUFSIZE * 2 + 35];
char *p;
/* On WinNT, 'start' is a shell built-in for cmd.exe rather than an
@@ -498,7 +498,7 @@ remove_tail(char *path)
}
char installdir[BUFSIZE]; /* top of the installation dir, where the
char installdir[MAX_PATH-9]; /* top of the installation dir, where the
install.exe is located, E.g.:
"c:\vim\vim60" */
int runtimeidx; /* index in installdir[] where "vim60" starts */
@@ -512,7 +512,7 @@ char *sysdrive; /* system drive or "c:\" */
do_inits(char **argv)
{
/* Find out the full path of our executable. */
if (my_fullpath(installdir, argv[0], BUFSIZE) == NULL)
if (my_fullpath(installdir, argv[0], sizeof(installdir)) == NULL)
{
printf("ERROR: Cannot get name of executable\n");
myexit(1);
+51 -24
View File
@@ -9365,32 +9365,65 @@ assert_inrange(typval_T *argvars)
{
garray_T ga;
int error = FALSE;
varnumber_T lower = tv_get_number_chk(&argvars[0], &error);
varnumber_T upper = tv_get_number_chk(&argvars[1], &error);
varnumber_T actual = tv_get_number_chk(&argvars[2], &error);
char_u *tofree;
char msg[200];
char_u numbuf[NUMBUFLEN];
if (error)
return 0;
if (actual < lower || actual > upper)
#ifdef FEAT_FLOAT
if (argvars[0].v_type == VAR_FLOAT
|| argvars[1].v_type == VAR_FLOAT
|| argvars[2].v_type == VAR_FLOAT)
{
prepare_assert_error(&ga);
if (argvars[3].v_type != VAR_UNKNOWN)
float_T flower = tv_get_float(&argvars[0]);
float_T fupper = tv_get_float(&argvars[1]);
float_T factual = tv_get_float(&argvars[2]);
if (factual < flower || factual > fupper)
{
ga_concat(&ga, tv2string(&argvars[3], &tofree, numbuf, 0));
vim_free(tofree);
prepare_assert_error(&ga);
if (argvars[3].v_type != VAR_UNKNOWN)
{
ga_concat(&ga, tv2string(&argvars[3], &tofree, numbuf, 0));
vim_free(tofree);
}
else
{
vim_snprintf(msg, 200, "Expected range %g - %g, but got %g",
flower, fupper, factual);
ga_concat(&ga, (char_u *)msg);
}
assert_error(&ga);
ga_clear(&ga);
return 1;
}
else
}
else
#endif
{
varnumber_T lower = tv_get_number_chk(&argvars[0], &error);
varnumber_T upper = tv_get_number_chk(&argvars[1], &error);
varnumber_T actual = tv_get_number_chk(&argvars[2], &error);
if (error)
return 0;
if (actual < lower || actual > upper)
{
vim_snprintf(msg, 200, "Expected range %ld - %ld, but got %ld",
prepare_assert_error(&ga);
if (argvars[3].v_type != VAR_UNKNOWN)
{
ga_concat(&ga, tv2string(&argvars[3], &tofree, numbuf, 0));
vim_free(tofree);
}
else
{
vim_snprintf(msg, 200, "Expected range %ld - %ld, but got %ld",
(long)lower, (long)upper, (long)actual);
ga_concat(&ga, (char_u *)msg);
ga_concat(&ga, (char_u *)msg);
}
assert_error(&ga);
ga_clear(&ga);
return 1;
}
assert_error(&ga);
ga_clear(&ga);
return 1;
}
return 0;
}
@@ -9822,14 +9855,8 @@ typval_compare(
{
float_T f1, f2;
if (typ1->v_type == VAR_FLOAT)
f1 = typ1->vval.v_float;
else
f1 = tv_get_number(typ1);
if (typ2->v_type == VAR_FLOAT)
f2 = typ2->vval.v_float;
else
f2 = tv_get_number(typ2);
f1 = tv_get_float(typ1);
f2 = tv_get_float(typ2);
n1 = FALSE;
switch (type)
{
+1 -1
View File
@@ -6166,7 +6166,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#if defined(UNIX) && (defined(__CYGWIN32__) || defined(__CYGWIN__))
"win32unix",
#endif
#if defined(WIN64) || defined(_WIN64)
#ifdef _WIN64
"win64",
#endif
#ifdef EBCDIC
+25 -12
View File
@@ -296,16 +296,20 @@ static int sort_abort; /* flag to indicate if sorting has been interrupted */
/* Struct to store info to be sorted. */
typedef struct
{
linenr_T lnum; /* line number */
linenr_T lnum; // line number
union {
struct
{
varnumber_T start_col_nr; /* starting column number */
varnumber_T end_col_nr; /* ending column number */
varnumber_T start_col_nr; // starting column number
varnumber_T end_col_nr; // ending column number
} line;
varnumber_T value; /* value if sorting by integer */
struct
{
varnumber_T value; // value if sorting by integer
int is_number; // TRUE when line contains a number
} num;
#ifdef FEAT_FLOAT
float_T value_flt; /* value if sorting by float */
float_T value_flt; // value if sorting by float
#endif
} st_u;
} sorti_T;
@@ -335,11 +339,14 @@ sort_compare(const void *s1, const void *s2)
if (got_int)
sort_abort = TRUE;
/* When sorting numbers "start_col_nr" is the number, not the column
* number. */
if (sort_nr)
result = l1.st_u.value == l2.st_u.value ? 0
: l1.st_u.value > l2.st_u.value ? 1 : -1;
{
if (l1.st_u.num.is_number != l2.st_u.num.is_number)
result = l1.st_u.num.is_number - l2.st_u.num.is_number;
else
result = l1.st_u.num.value == l2.st_u.num.value ? 0
: l1.st_u.num.value > l2.st_u.num.value ? 1 : -1;
}
#ifdef FEAT_FLOAT
else if (sort_flt)
result = l1.st_u.value_flt == l2.st_u.value_flt ? 0
@@ -553,11 +560,17 @@ ex_sort(exarg_T *eap)
if (s > p && s[-1] == '-')
--s; /* include preceding negative sign */
if (*s == NUL)
/* empty line should sort before any number */
nrs[lnum - eap->line1].st_u.value = -MAXLNUM;
{
/* line without number should sort before any number */
nrs[lnum - eap->line1].st_u.num.is_number = FALSE;
nrs[lnum - eap->line1].st_u.num.value = 0;
}
else
{
nrs[lnum - eap->line1].st_u.num.is_number = TRUE;
vim_str2nr(s, NULL, NULL, sort_what,
&nrs[lnum - eap->line1].st_u.value, NULL, 0);
&nrs[lnum - eap->line1].st_u.num.value, NULL, 0);
}
}
#ifdef FEAT_FLOAT
else
+1 -1
View File
@@ -5139,7 +5139,7 @@ vim_fsync(int fd)
# ifdef MACOS_X
r = fcntl(fd, F_FULLFSYNC);
if (r != 0 && errno == ENOTTY)
if (r != 0) // F_FULLFSYNC not working or not supported
# endif
r = fsync(fd);
return r;
+13 -2
View File
@@ -730,6 +730,7 @@ emsg(char *s)
return TRUE; /* no error messages at the moment */
}
#ifndef PROTO // manual proto with __attribute__
/*
* Print an error message with format string and variable arguments.
* Note: caller must not pass 'IObuff' as 1st argument.
@@ -749,6 +750,7 @@ semsg(const char *s, ...)
}
return TRUE; /* no error messages at the moment */
}
#endif
/*
* Same as emsg(...), but abort on error when ABORT_ON_INTERNAL_ERROR is
@@ -765,6 +767,7 @@ iemsg(char *s)
#endif
}
#ifndef PROTO // manual proto with __attribute__
/*
* Same as semsg(...) but abort on error when ABORT_ON_INTERNAL_ERROR is
* defined. It is used for internal errors only, so that they can be
@@ -783,10 +786,11 @@ siemsg(const char *s, ...)
va_end(ap);
emsg_core(IObuff);
}
#ifdef ABORT_ON_INTERNAL_ERROR
# ifdef ABORT_ON_INTERNAL_ERROR
abort();
#endif
# endif
}
#endif
/*
* Give an "Internal error" message.
@@ -2628,12 +2632,19 @@ msg_puts_printf(char_u *str, int maxlen)
if (*p != NUL && !(silent_mode && p_verbose == 0))
{
int c = -1;
if (maxlen > 0 && STRLEN(p) > (size_t)maxlen)
{
c = p[maxlen];
p[maxlen] = 0;
}
if (info_message)
mch_msg((char *)p);
else
mch_errmsg((char *)p);
if (c != -1)
p[maxlen] = c;
}
msg_didout = TRUE; // assume that line is not empty
+5
View File
@@ -2854,6 +2854,11 @@ changed(void)
changed_int();
}
++CHANGEDTICK(curbuf);
#ifdef FEAT_SEARCH_EXTRA
// If a pattern is highlighted, the position may now be invalid.
highlight_match = FALSE;
#endif
}
/*
+1154 -368
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -134,6 +134,28 @@ smsg_attr_keep(int, const char *, ...)
#endif
;
/* These prototypes cannot be produced automatically. */
int
# ifdef __BORLANDC__
_RTLENTRYF
# endif
semsg(const char *, ...)
#ifdef USE_PRINTF_FORMAT_ATTRIBUTE
__attribute__((format(printf, 1, 0)))
#endif
;
/* These prototypes cannot be produced automatically. */
void
# ifdef __BORLANDC__
_RTLENTRYF
# endif
siemsg(const char *, ...)
#ifdef USE_PRINTF_FORMAT_ATTRIBUTE
__attribute__((format(printf, 1, 0)))
#endif
;
int
# ifdef __BORLANDC__
_RTLENTRYF
-2
View File
@@ -11,9 +11,7 @@ int emsg_not_now(void);
void ignore_error_for_testing(char_u *error);
void do_perror(char *msg);
int emsg(char *s);
int semsg(const char *s, ...);
void iemsg(char *s);
void siemsg(const char *s, ...);
void internal_error(char *where);
void emsg_invreg(int name);
char *msg_trunc_attr(char *s, int force, int attr);
+6 -1
View File
@@ -7969,6 +7969,7 @@ vim_regcomp(char_u *expr_arg, int re_flags)
{
regprog_T *prog = NULL;
char_u *expr = expr_arg;
int save_called_emsg;
regexp_engine = p_re;
@@ -8004,6 +8005,8 @@ vim_regcomp(char_u *expr_arg, int re_flags)
/*
* First try the NFA engine, unless backtracking was requested.
*/
save_called_emsg = called_emsg;
called_emsg = FALSE;
if (regexp_engine != BACKTRACKING_ENGINE)
prog = nfa_regengine.regcomp(expr,
re_flags + (regexp_engine == AUTOMATIC_ENGINE ? RE_AUTO : 0));
@@ -8032,13 +8035,15 @@ vim_regcomp(char_u *expr_arg, int re_flags)
* If the NFA engine failed, try the backtracking engine.
* The NFA engine also fails for patterns that it can't handle well
* but are still valid patterns, thus a retry should work.
* But don't try if an error message was given.
*/
if (regexp_engine == AUTOMATIC_ENGINE)
if (regexp_engine == AUTOMATIC_ENGINE && !called_emsg)
{
regexp_engine = BACKTRACKING_ENGINE;
prog = bt_regengine.regcomp(expr, re_flags);
}
}
called_emsg |= save_called_emsg;
if (prog != NULL)
{
+5 -7
View File
@@ -509,10 +509,13 @@ nfa_get_match_text(nfa_state_T *start)
realloc_post_list(void)
{
int nstate_max = (int)(post_end - post_start);
int new_max = nstate_max + 1000;
int new_max;
int *new_start;
int *old_start;
// For weird patterns the number of states can be very high. Increasing by
// 50% seems a reasonable compromise between memory use and speed.
new_max = nstate_max * 3 / 2;
new_start = (int *)lalloc(new_max * sizeof(int), TRUE);
if (new_start == NULL)
return FAIL;
@@ -1472,7 +1475,7 @@ nfa_regatom(void)
default: nr = -1; break;
}
if (nr < 0)
if (nr < 0 || nr > INT_MAX)
EMSG2_RET_FAIL(
_("E678: Invalid character after %s%%[dxouU]"),
reg_magic == MAGIC_ALL);
@@ -7249,12 +7252,7 @@ nfa_regcomp(char_u *expr, int re_flags)
* (and count its size). */
postfix = re2post();
if (postfix == NULL)
{
/* TODO: only give this error for debugging? */
if (post_ptr >= post_end)
siemsg("Internal error: estimated max number of states insufficient: %ld", post_end - post_start);
goto fail; /* Cascaded (syntax?) error */
}
/*
* In order to build the NFA, we parse the input regexp twice:
+3 -3
View File
@@ -2551,10 +2551,10 @@ text_to_screenline(win_T *wp, char_u *text, int col)
{
#ifdef FEAT_RIGHTLEFT
if (wp->w_p_rl)
STRNCPY(current_ScreenLine, text, len);
mch_memmove(current_ScreenLine, text, len);
else
#endif
STRNCPY(current_ScreenLine + col, text, len);
mch_memmove(current_ScreenLine + col, text, len);
col += len;
}
}
@@ -3400,7 +3400,7 @@ win_line(
{
if (lnum == curwin->w_cursor.lnum)
getvcol(curwin, &(curwin->w_cursor),
(colnr_T *)&fromcol, NULL, NULL);
(colnr_T *)&fromcol, NULL, NULL);
else
fromcol = 0;
if (lnum == curwin->w_cursor.lnum + search_match_lines)
+27 -11
View File
@@ -4368,11 +4368,12 @@ current_quote(
int col_end;
int col_start = curwin->w_cursor.col;
int inclusive = FALSE;
int vis_empty = TRUE; /* Visual selection <= 1 char */
int vis_bef_curs = FALSE; /* Visual starts before cursor */
int inside_quotes = FALSE; /* Looks like "i'" done before */
int selected_quote = FALSE; /* Has quote inside selection */
int vis_empty = TRUE; // Visual selection <= 1 char
int vis_bef_curs = FALSE; // Visual starts before cursor
int inside_quotes = FALSE; // Looks like "i'" done before
int selected_quote = FALSE; // Has quote inside selection
int i;
int restore_vis_bef = FALSE; // restore VIsual on abort
/* Correct cursor when 'selection' is "exclusive". */
if (VIsual_active)
@@ -4386,12 +4387,13 @@ current_quote(
{
if (!vis_bef_curs)
{
/* VIsual needs to be start of Visual selection. */
// VIsual needs to be the start of Visual selection.
pos_T t = curwin->w_cursor;
curwin->w_cursor = VIsual;
VIsual = t;
vis_bef_curs = TRUE;
restore_vis_bef = TRUE;
}
dec_cursor();
}
@@ -4440,7 +4442,7 @@ current_quote(
* opening quote. */
col_start = find_next_quote(line, col_start + 1, quotechar, NULL);
if (col_start < 0)
return FALSE;
goto abort_search;
col_end = find_next_quote(line, col_start + 1, quotechar,
curbuf->b_p_qe);
if (col_end < 0)
@@ -4454,7 +4456,7 @@ current_quote(
{
col_end = find_prev_quote(line, col_start, quotechar, NULL);
if (line[col_end] != quotechar)
return FALSE;
goto abort_search;
col_start = find_prev_quote(line, col_end, quotechar,
curbuf->b_p_qe);
if (line[col_start] != quotechar)
@@ -4489,12 +4491,12 @@ current_quote(
/* Find open quote character. */
col_start = find_next_quote(line, col_start, quotechar, NULL);
if (col_start < 0 || col_start > first_col)
return FALSE;
goto abort_search;
/* Find close quote character. */
col_end = find_next_quote(line, col_start + 1, quotechar,
curbuf->b_p_qe);
if (col_end < 0)
return FALSE;
goto abort_search;
/* If is cursor between start and end quote character, it is
* target text object. */
if (col_start <= first_col && first_col <= col_end)
@@ -4511,14 +4513,14 @@ current_quote(
/* No quote before the cursor, look after the cursor. */
col_start = find_next_quote(line, col_start, quotechar, NULL);
if (col_start < 0)
return FALSE;
goto abort_search;
}
/* Find close quote character. */
col_end = find_next_quote(line, col_start + 1, quotechar,
curbuf->b_p_qe);
if (col_end < 0)
return FALSE;
goto abort_search;
}
/* When "include" is TRUE, include spaces after closing quote or before
@@ -4605,6 +4607,20 @@ current_quote(
}
return OK;
abort_search:
if (VIsual_active && *p_sel == 'e')
{
inc_cursor();
if (restore_vis_bef)
{
pos_T t = curwin->w_cursor;
curwin->w_cursor = VIsual;
VIsual = t;
}
}
return FALSE;
}
#endif /* FEAT_TEXTOBJ */
+1 -1
View File
@@ -148,7 +148,7 @@ newtests: newtestssilent
newtestssilent: $(NEW_TESTS_RES)
.vim.res: writevimcmd
.vim.res:
@echo "$(VIMPROG)" > vimcmd
@echo "$(RUN_VIMTEST)" >> vimcmd
$(RUN_VIMTEST) $(NO_INITS) -S runtest.vim $*.vim $(REDIR_TEST_TO_NULL)
+20
View File
@@ -0,0 +1,20 @@
|++0#0000e05#a8a8a8255| >+|-@1| @1|3| |l|i|n|e|s|:| |1|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|3| |l|i|n|e|s|:| |1|-@19
| @1|4+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33
| +0#0000e05#a8a8a8255@1|4+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33
|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |6|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |6|-@19
| @1|1+0#0000000#ffffff0|0| @32||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32
| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|1+0#0000000#5fd7ff255@1| @32
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|c|o|n|t|e|x|t|:|0| @51
+20
View File
@@ -0,0 +1,20 @@
|++0#0000e05#a8a8a8255| >+|-@1| @1|3| |l|i|n|e|s|:| |1|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|3| |l|i|n|e|s|:| |1|-@19
| @1|4+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33
| +0#0000e05#a8a8a8255@1|4+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33
|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |6|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |6|-@19
| @1|1+0#0000000#ffffff0|0| @32||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32
| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|1+0#0000000#5fd7ff255@1| @32
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|c|o|n|t|e|x|t|:|1| @51
+20
View File
@@ -0,0 +1,20 @@
|++0#0000e05#a8a8a8255| >+|-@1| @1|2| |l|i|n|e|s|:| |1|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |1|-@19
| @1|3+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33
| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33
| +0#0000e05#a8a8a8255@1|4+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33
| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33
|++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |7|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|2| |l|i|n|e|s|:| |7|-@19
| @1|9+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33
| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32
| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|1+0#0000000#5fd7ff255@1| @32
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33
|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1
|:+0&&@1|s|e|t| |d|i|f@1|o|p|t|+|=|c|o|n|t|e|x|t|:|2| @50
@@ -0,0 +1,9 @@
|o+0&#ffffff0|n|e| @66
|x| @68
|t|h|r|e@1| @64
|~+0#4040ff13&| @68
|~| @68
|~| @68
|~| @68
|~| @68
|:+0#0000000&|%|s|/|X> @64
+4 -1
View File
@@ -50,7 +50,9 @@ source setup.vim
set nocp viminfo+=nviminfo
" Use utf-8 by default, instead of whatever the system default happens to be.
" Individual tests can overrule this at the top of the file.
" Individual tests can overrule this at the top of the file and use
" g:orig_encoding if needed.
let g:orig_encoding = &encoding
set encoding=utf-8
" REDIR_TEST_TO_NULL has a very permissive SwapExists autocommand which is for
@@ -307,6 +309,7 @@ let s:flaky_tests = [
\ 'Test_terminal_ansicolors_func()',
\ 'Test_terminal_ansicolors_global()',
\ 'Test_terminal_composing_unicode()',
\ 'Test_terminal_does_not_truncate_last_newlines()',
\ 'Test_terminal_env()',
\ 'Test_terminal_hide_buffer()',
\ 'Test_terminal_make_change()',
+14 -1
View File
@@ -111,7 +111,9 @@ func VerifyScreenDump(buf, filename, options, ...)
sleep 10m
call delete(testfile)
call term_dumpwrite(a:buf, testfile, a:options)
if readfile(reference) == readfile(testfile)
let testdump = readfile(testfile)
let refdump = readfile(reference)
if refdump == testdump
call delete(testfile)
break
endif
@@ -121,6 +123,17 @@ func VerifyScreenDump(buf, filename, options, ...)
if a:0 == 1
let msg = a:1 . ': ' . msg
endif
if len(testdump) != len(refdump)
let msg = msg . '; line count is ' . len(testdump) . ' instead of ' . len(refdump)
endif
for i in range(len(refdump))
if i >= len(testdump)
break
endif
if testdump[i] != refdump[i]
let msg = msg . '; difference in line ' . (i + 1) . ': "' . testdump[i] . '"'
endif
endfor
call assert_report(msg)
return 1
endif
+16
View File
@@ -190,6 +190,22 @@ func Test_assert_inrange()
call remove(v:errors, 0)
call assert_fails('call assert_inrange(1, 1)', 'E119:')
if has('float')
call assert_equal(0, assert_inrange(7.0, 7, 7))
call assert_equal(0, assert_inrange(7, 7.0, 7))
call assert_equal(0, assert_inrange(7, 7, 7.0))
call assert_equal(0, assert_inrange(5, 7, 5.0))
call assert_equal(0, assert_inrange(5, 7, 6.0))
call assert_equal(0, assert_inrange(5, 7, 7.0))
call assert_equal(1, assert_inrange(5, 7, 4.0))
call assert_match("Expected range 5.0 - 7.0, but got 4.0", v:errors[0])
call remove(v:errors, 0)
call assert_equal(1, assert_inrange(5, 7, 8.0))
call assert_match("Expected range 5.0 - 7.0, but got 8.0", v:errors[0])
call remove(v:errors, 0)
endif
endfunc
func Test_assert_with_msg()
+11
View File
@@ -783,6 +783,17 @@ func Test_diff_screen()
call WriteDiffFiles(buf, [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
call VerifyBoth(buf, 'Test_diff_06', '')
" Variants on test 6 with different context settings
call term_sendkeys(buf, ":set diffopt+=context:2\<cr>")
call VerifyScreenDump(buf, 'Test_diff_06.2', {})
call term_sendkeys(buf, ":set diffopt-=context:2\<cr>")
call term_sendkeys(buf, ":set diffopt+=context:1\<cr>")
call VerifyScreenDump(buf, 'Test_diff_06.1', {})
call term_sendkeys(buf, ":set diffopt-=context:1\<cr>")
call term_sendkeys(buf, ":set diffopt+=context:0\<cr>")
call VerifyScreenDump(buf, 'Test_diff_06.0', {})
call term_sendkeys(buf, ":set diffopt-=context:0\<cr>")
" Test 7 - 9: Test normal/patience/histogram diff algorithm
call WriteDiffFiles(buf, ['#include <stdio.h>', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{',
\ ' int i;', ' for(i = 0; i < 10; i++)', ' {', ' printf("Your answer is: ");',
+11
View File
@@ -130,3 +130,14 @@ func Test_range_with_newline()
call assert_equal(0, search("[ -*\\t-\\n]"))
bwipe!
endfunc
func Test_pattern_compile_speed()
if !exists('+spellcapcheck') || !has('reltime')
return
endif
let start = reltime()
" this used to be very slow, not it should be about a second
set spc=\\v(((((Nxxxxxxx&&xxxx){179})+)+)+){179}
call assert_inrange(0.01, 10.0, reltimefloat(reltime(start)))
set spc=
endfunc
+38
View File
@@ -981,6 +981,30 @@ func Test_incsearch_substitute_dump()
call delete('Xis_subst_script')
endfunc
func Test_incsearch_with_change()
if !has('timers') || !exists('+incsearch') || !CanRunVimInTerminal()
return
endif
call writefile([
\ 'set incsearch hlsearch scrolloff=0',
\ 'call setline(1, ["one", "two ------ X", "three"])',
\ 'call timer_start(200, { _ -> setline(2, "x")})',
\ ], 'Xis_change_script')
let buf = RunVimInTerminal('-S Xis_change_script', {'rows': 9, 'cols': 70})
" Give Vim a chance to redraw to get rid of the spaces in line 2 caused by
" the 'ambiwidth' check.
sleep 300m
" Highlight X, it will be deleted by the timer callback.
call term_sendkeys(buf, ':%s/X')
call VerifyScreenDump(buf, 'Test_incsearch_change_01', {})
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
call delete('Xis_change_script')
endfunc
" Similar to Test_incsearch_substitute_dump() for :sort
func Test_incsearch_sort_dump()
if !exists('+incsearch')
@@ -1187,3 +1211,17 @@ func Test_search_Ctrl_L_combining()
call assert_equal(bufcontent[1], @/)
call Incsearch_cleanup()
endfunc
func Test_large_hex_chars()
" This used to cause a crash, the character becomes an NFA state.
try
/\%Ufffffc23
catch
call assert_match('E678:', v:exception)
endtry
endfunc
func Test_one_error_msg()
" This was also giving an internal error
call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:')
endfunc
+71
View File
@@ -1222,6 +1222,77 @@ func Test_sort_cmd()
enew!
endfunc
func Test_sort_large_num()
new
a
-2147483648
-2147483647
-1
0
1
-2147483646
2147483646
2147483647
2147483647
-2147483648
abc
.
" Numerical sort. Non-numeric lines are ordered before numerical lines.
" Ordering of non-numerical is stable.
sort n
call assert_equal(['',
\ 'abc',
\ '',
\ '-2147483648',
\ '-2147483648',
\ '-2147483647',
\ '-2147483646',
\ '-1',
\ '0',
\ '1',
\ '2147483646',
\ '2147483647',
\ '2147483647'], getline(1, '$'))
bwipe!
if has('num64')
new
a
-9223372036854775808
-9223372036854775807
-1
0
1
-9223372036854775806
9223372036854775806
9223372036854775807
9223372036854775807
-9223372036854775808
abc
.
sort n
call assert_equal(['',
\ 'abc',
\ '',
\ '-9223372036854775808',
\ '-9223372036854775808',
\ '-9223372036854775807',
\ '-9223372036854775806',
\ '-1',
\ '0',
\ '1',
\ '9223372036854775806',
\ '9223372036854775807',
\ '9223372036854775807'], getline(1, '$'))
bwipe!
endif
endfunc
func Test_sort_cmd_report()
enew!
call append(0, repeat([1], 3) + repeat([2], 3) + repeat([3], 3))
+10
View File
@@ -537,3 +537,13 @@ func Test_zzz_startinsert()
endif
call delete('Xtestout')
endfunc
func Test_issue_3969()
if has('gui_running')
" Can't catch the output of gvim.
return
endif
" Check that message is not truncated.
let out = system(GetVimCommand() . ' -es -X -V1 -c "echon ''hello''" -cq')
call assert_equal('hello', out)
endfunc
+23
View File
@@ -1574,7 +1574,13 @@ func Test_terminal_termwinsize_mininmum()
endfunc
func Test_terminal_termwinkey()
" make three tabpages, terminal in the middle
0tabnew
tabnext
tabnew
tabprev
call assert_equal(1, winnr('$'))
call assert_equal(2, tabpagenr())
let thiswin = win_getid()
let buf = Run_shell_in_terminal({})
@@ -1583,12 +1589,29 @@ func Test_terminal_termwinkey()
call feedkeys("\<C-L>w", 'tx')
call assert_equal(thiswin, win_getid())
call feedkeys("\<C-W>w", 'tx')
call assert_equal(termwin, win_getid())
call feedkeys("\<C-L>gt", "xt")
call assert_equal(3, tabpagenr())
tabprev
call assert_equal(2, tabpagenr())
call assert_equal(termwin, win_getid())
call feedkeys("\<C-L>gT", "xt")
call assert_equal(1, tabpagenr())
tabnext
call assert_equal(2, tabpagenr())
call assert_equal(termwin, win_getid())
let job = term_getjob(buf)
call feedkeys("\<C-L>\<C-C>", 'tx')
call WaitForAssert({-> assert_equal("dead", job_status(job))})
set termwinkey&
tabnext
tabclose
tabprev
tabclose
endfunc
func Test_terminal_out_err()
+25
View File
@@ -52,6 +52,31 @@ func Test_quote_selection_selection_exclusive()
bw!
endfunc
func Test_quote_selection_selection_exclusive_abort()
new
set selection=exclusive
call setline(1, "'abzzc'")
let exp_curs = [0, 1, 6, 0]
call cursor(1,1)
exe 'norm! fcdvi"'
" make sure to end visual mode to have a clear state
exe "norm! \<esc>"
call assert_equal(exp_curs, getpos('.'))
call cursor(1,1)
exe 'norm! fcvi"'
exe "norm! \<esc>"
call assert_equal(exp_curs, getpos('.'))
call cursor(1,2)
exe 'norm! vfcoi"'
exe "norm! \<esc>"
let exp_curs = [0, 1, 2, 0]
let exp_visu = [0, 1, 7, 0]
call assert_equal(exp_curs, getpos('.'))
call assert_equal(exp_visu, getpos("'>"))
set selection&vim
bw!
endfunc
" Tests for string and html text objects
func Test_string_html_objects()
enew!
+2 -1
View File
@@ -518,7 +518,8 @@ endfunc
" screenshot test with textprop highlighting
funct Test_textprop_screenshots()
if !CanRunVimInTerminal() || &encoding != 'utf-8'
" The Vim running in the terminal needs to use utf-8.
if !CanRunVimInTerminal() || g:orig_encoding != 'utf-8'
return
endif
call writefile([
+6 -2
View File
@@ -17,6 +17,7 @@
* Text properties have a type, which can be used to specify highlighting.
*
* TODO:
* - When using 'cursorline' attributes should be merged. (#3912)
* - Adjust text property column and length when text is inserted/deleted.
* -> a :substitute with a multi-line match
* -> search for changed_bytes() from misc1.c
@@ -27,7 +28,10 @@
* the index, like DB_MARKED?
* - Also test line2byte() with many lines, so that ml_updatechunk() is taken
* into account.
* - add mechanism to keep track of changed lines.
* - Add mechanism to keep track of changed lines, so that plugin can update
* text properties in these.
* - Perhaps have a window-local option to disable highlighting from text
* properties?
*/
#include "vim.h"
@@ -158,7 +162,7 @@ f_prop_add(typval_T *argvars, typval_T *rettv UNUSED)
char_u *newtext;
int proplen;
size_t textlen;
char_u *props;
char_u *props = NULL;
char_u *newprops;
textprop_T tmp_prop;
int i;
+7 -9
View File
@@ -60,11 +60,10 @@ reg_delete_key(HKEY hRootKey, const char *key, DWORD flag)
* Returns non-zero when it's found.
*/
static int
popup_gvim_path(char *buf)
popup_gvim_path(char *buf, DWORD bufsize)
{
HKEY key_handle;
DWORD value_type;
DWORD bufsize = BUFSIZE;
int r;
/* Open the key where the path to gvim.exe is stored. */
@@ -87,11 +86,10 @@ popup_gvim_path(char *buf)
* Returns non-zero when it's found.
*/
static int
openwith_gvim_path(char *buf)
openwith_gvim_path(char *buf, DWORD bufsize)
{
HKEY key_handle;
DWORD value_type;
DWORD bufsize = BUFSIZE;
int r;
/* Open the key where the path to gvim.exe is stored. */
@@ -209,7 +207,7 @@ batfile_thisversion(char *path)
fd = fopen(path, "r");
if (fd != NULL)
{
while (fgets(line, BUFSIZE, fd) != NULL)
while (fgets(line, sizeof(line), fd) != NULL)
{
for (p = line; *p != 0; ++p)
/* don't accept "vim60an" when looking for "vim60". */
@@ -321,8 +319,8 @@ main(int argc, char *argv[])
int i;
struct stat st;
char icon[BUFSIZE];
char path[BUFSIZE];
char popup_path[BUFSIZE];
char path[MAX_PATH];
char popup_path[MAX_PATH];
/* The nsis uninstaller calls us with a "-nsis" argument. */
if (argc == 2 && stricmp(argv[1], "-nsis") == 0)
@@ -335,7 +333,7 @@ main(int argc, char *argv[])
printf("This program will remove the following items:\n");
if (popup_gvim_path(popup_path))
if (popup_gvim_path(popup_path, sizeof(popup_path)))
{
printf(" - the \"Edit with Vim\" entry in the popup menu\n");
printf(" which uses \"%s\"\n", popup_path);
@@ -349,7 +347,7 @@ main(int argc, char *argv[])
remove_openwith();
}
}
else if (openwith_gvim_path(popup_path))
else if (openwith_gvim_path(popup_path, sizeof(popup_path)))
{
printf(" - the Vim \"Open With...\" entry in the popup menu\n");
printf(" which uses \"%s\"\n", popup_path);
+52
View File
@@ -794,6 +794,58 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
976,
/**/
975,
/**/
974,
/**/
973,
/**/
972,
/**/
971,
/**/
970,
/**/
969,
/**/
968,
/**/
967,
/**/
966,
/**/
965,
/**/
964,
/**/
963,
/**/
962,
/**/
961,
/**/
960,
/**/
959,
/**/
958,
/**/
957,
/**/
956,
/**/
955,
/**/
954,
/**/
953,
/**/
952,
/**/
951,
/**/
950,
/**/
+10 -10
View File
@@ -54,6 +54,9 @@
Error: configure did not run properly. Check auto/config.log.
# endif
// for INT_MAX, LONG_MAX et al.
#include <limits.h>
/*
* Cygwin may have fchdir() in a newer release, but in most versions it
* doesn't work well and avoiding it keeps the binary backward compatible.
@@ -456,9 +459,6 @@ typedef unsigned int u8char_T; // int is 32 bits or more
# include <errno.h>
#endif
/* for INT_MAX et al. */
#include <limits.h>
/*
* Allow other (non-unix) systems to configure themselves now
* These are also in os_unix.h, because osdef.sh needs them there.
@@ -1668,17 +1668,17 @@ typedef unsigned short disptick_T; /* display tick type */
* not a real problem. BTW: Longer lines are split.
*/
#ifdef __MVS__
# define MAXCOL (0x3fffffffL) /* maximum column number, 30 bits */
# define MAXLNUM (0x3fffffffL) /* maximum (invalid) line number */
# define MAXCOL (0x3fffffffL) // maximum column number, 30 bits
# define MAXLNUM (0x3fffffffL) // maximum (invalid) line number
#else
# define MAXCOL (0x7fffffffL) /* maximum column number, 31 bits */
# define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
# define MAXCOL INT_MAX // maximum column number
# define MAXLNUM LONG_MAX // maximum (invalid) line number
#endif
#define SHOWCMD_COLS 10 /* columns needed by shown command */
#define STL_MAX_ITEM 80 /* max nr of %<flag> in statusline */
#define SHOWCMD_COLS 10 // columns needed by shown command
#define STL_MAX_ITEM 80 // max nr of %<flag> in statusline
typedef void *vim_acl_T; /* dummy to pass an ACL to a function */
typedef void *vim_acl_T; // dummy to pass an ACL to a function
#ifndef mch_memmove
# define mch_memmove(to, from, len) memmove((char*)(to), (char*)(from), (size_t)(len))
+10 -5
View File
@@ -67,7 +67,7 @@ static win_T *win_alloc(win_T *after, int hidden);
static char *m_onlyone = N_("Already only one window");
/*
* all CTRL-W window commands are handled here, called from normal_cmd().
* All CTRL-W window commands are handled here, called from normal_cmd().
*/
void
do_window(
@@ -87,10 +87,7 @@ do_window(
#endif
char_u cbuf[40];
if (Prenum == 0)
Prenum1 = 1;
else
Prenum1 = Prenum;
Prenum1 = Prenum == 0 ? 1 : Prenum;
#ifdef FEAT_CMDWIN
# define CHECK_CMDWIN \
@@ -584,6 +581,14 @@ wingotofile:
nchar = xchar;
goto wingotofile;
#endif
case 't': // CTRL-W gt: go to next tab page
goto_tabpage((int)Prenum);
break;
case 'T': // CTRL-W gT: go to previous tab page
goto_tabpage(-(int)Prenum1);
break;
default:
beep_flush();
break;