Compare commits

...

8 Commits

Author SHA1 Message Date
0cbcd949e1 patch 8.0.1431: MS-Windows: vimtutor fails if %TMP% has special chars
Problem:    MS-Windows: vimtutor fails if %TMP% has special chars.
Solution:   Add quotes. (Tamce, closes #2561)
2018-01-26 22:22:55 +01:00
4aad53c369 patch 8.0.1430: crash when term_start() fails
Problem:    Crash when term_start() fails.
Solution:   Initialize winpty_err.
2018-01-26 21:11:03 +01:00
ede35bbbd0 patch 8.0.1429: crash when calling term_start() with empty argument
Problem:    Crash when calling term_start() with empty argument.
Solution:   Check for invalid argument. (Yasuhiro Matsomoto, closes #2503)
            Fix memory leak.
2018-01-26 20:05:18 +01:00
200ea8ffaa patch 8.0.1428: compiler warning on 64 bit MS-Windows system
Problem:    Compiler warning on 64 bit MS-Windows system.
Solution:   Change type from "int" to "size_t". (Mike Williams)
2018-01-02 15:37:46 +01:00
de04654ddc patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Problem:    The :leftabove modifier doesn't work for :copen.
Solution:   Respect the split modifier. (Yegappan Lakshmanan, closes #2496)
2017-12-26 13:53:11 +01:00
9e3dfc6501 patch 8.0.1426: "gf" and <cfile> don't accept ? and & in URL
Problem:    "gf" and <cfile> don't accept ? and & in URL. (Dmitrii Tcyganok)
Solution:   Check for a URL and allow for extra characters. (closes #2493)
2017-12-25 14:29:18 +01:00
2095148277 patch 8.0.1425: execute() does not work in completion of user command
Problem:    execute() does not work in completion of user command. (thinca)
Solution:   Switch off redir_off and restore it. (Ozaki Kiichi, closes #2492)
2017-12-25 13:44:43 +01:00
df980db69b update a few runtime files 2017-12-24 13:22:00 +01:00
18 changed files with 176 additions and 49 deletions

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2017 Dec 01
*options.txt* For Vim version 8.0. Last change: 2017 Dec 21
VIM REFERENCE MANUAL by Bram Moolenaar
@ -5749,11 +5749,11 @@ A jump table for the options with a short description can be found at |Q_op|.
copy of the original file will be kept. The name of the copy is the
name of the original file with the string in the 'patchmode' option
appended. This option should start with a dot. Use a string like
".org". 'backupdir' must not be empty for this to work (Detail: The
backup file is renamed to the patchmode file after the new file has
been successfully written, that's why it must be possible to write a
backup file). If there was no file to be backed up, an empty file is
created.
".orig" or ".org". 'backupdir' must not be empty for this to work
(Detail: The backup file is renamed to the patchmode file after the
new file has been successfully written, that's why it must be possible
to write a backup file). If there was no file to be backed up, an
empty file is created.
When the 'backupskip' pattern matches, a patchmode file is not made.
Using 'patchmode' for compressed files appends the extension at the
end (e.g., "file.gz.orig"), thus the resulting name isn't always

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 8.0. Last change: 2017 Sep 30
*syntax.txt* For Vim version 8.0. Last change: 2017 Dec 22
VIM REFERENCE MANUAL by Bram Moolenaar
@ -5031,6 +5031,8 @@ TabLine tab pages line, not active tab page label
TabLineFill tab pages line, where there are no labels
*hl-TabLineSel*
TabLineSel tab pages line, active tab page label
*hl-Terminal*
Terminal |terminal| window (see |terminal-size-color|)
*hl-Title*
Title titles for output from ":set all", ":autocmd" etc.
*hl-Visual*

View File

@ -6828,6 +6828,7 @@ hl-StatusLineNC syntax.txt /*hl-StatusLineNC*
hl-TabLine syntax.txt /*hl-TabLine*
hl-TabLineFill syntax.txt /*hl-TabLineFill*
hl-TabLineSel syntax.txt /*hl-TabLineSel*
hl-Terminal syntax.txt /*hl-Terminal*
hl-Title syntax.txt /*hl-Title*
hl-Tooltip syntax.txt /*hl-Tooltip*
hl-User1 syntax.txt /*hl-User1*
@ -8064,6 +8065,7 @@ quake.vim syntax.txt /*quake.vim*
quickfix quickfix.txt /*quickfix*
quickfix-6 version6.txt /*quickfix-6*
quickfix-ID quickfix.txt /*quickfix-ID*
quickfix-changedtick quickfix.txt /*quickfix-changedtick*
quickfix-context quickfix.txt /*quickfix-context*
quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
quickfix-error-lists quickfix.txt /*quickfix-error-lists*

View File

@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.0. Last change: 2017 Dec 17
*terminal.txt* For Vim version 8.0. Last change: 2017 Dec 22
VIM REFERENCE MANUAL by Bram Moolenaar
@ -122,7 +122,8 @@ and background colors are taken from Vim, the Normal highlight group.
For a color terminal the 'background' option is used to decide whether the
terminal window will start with a white or black background.
To use a different color the Terminal highlight group can be used: >
To use a different color the Terminal highlight group can be used, for
example: >
hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Dec 17
*todo.txt* For Vim version 8.0. Last change: 2017 Dec 23
VIM REFERENCE MANUAL by Bram Moolenaar
@ -142,11 +142,19 @@ Suggested by Hiroki Kokubun:
Include solarized color scheme?, it does not support termguicolors.
- Sanitized version of pablo (Lifepillar, 2017 Nov 21)
heap use after free. (gy741, #2447)
heap use after free in set_bufref (gy741, #2448)
reproduces with valgrind (Dominique)
heap use after free in getout. (gy741, #2449)
reproduces with valgrind (Dominique)
Reproducible:
invalid memory access in regexp with zero-width.
reproduced by Dominique, 2017 Dec 23
heap-use-after-free in win_equal_rec (#2467)
au* 0 vs¡
ar0
arga
al
al
Errors found with random data:
heap-buffer-overflow in alist_add (#2472)
heap-buffer-overflow in del_bytes (#2466)
Compiler warnings (geeknik, 2017 Oct 26):
- signed integer overflow in do_sub() (#2249)
@ -155,20 +163,13 @@ Compiler warnings (geeknik, 2017 Oct 26):
- signed integer overflow in nfa_regatom() (#2251)
- undefined left shift in get_string_tv() (#2250)
Triggering CursorHoldI happens too often in the GUI. (#2451).
Should move code from os_unix.c mch_inchar() up into common use, it's not
really machine specific. Also the part of WaitForChar(), it deals with timers
and is also for all machines.
When starting with --clean packages under "start" are not loaded. Make this
work: :packadd START {name} similar to :runtime START name
balloon_show() does not work properly in the terminal. (Ben Jackson, 2017 Dec
20, #2481)
Also see #2352, want better control over balloon, perhaps set the position.
When using :packadd files under "later" are not used, which is inconsistent
with packages under "start". (xtal8, #1994)
Patch to add changedtick var to quickfix list. (Yegappan Lakshmanan, 2017 Nov
18, #2391)
7 Add a watchpoint in the debug mode: An expression that breaks execution
when evaluating to non-zero. Add the "watchadd expr" command, stop when
the value of the expression changes. ":watchdel" deletes an item,
@ -212,6 +213,9 @@ Error in emsg with buggy script. (Dominique, 2017 Apr 30)
Patch to avoid clearing the intro message on Win32 console.
(Ken Takata, 2017 Nov 14)
Patch to fix encoding in print document name (Yasuhiro Matsumoto, 2017 Dec 20,
#2478)
Patch to copy buffer-local options before buffer leaves the window. (Bjorn
Linse, 2017 Nov 14, #2336)
@ -233,6 +237,9 @@ Ask whether to use Windows or Vim key behavior?
Patch for improving detecting Ruby on Mac in configure. (Ilya Mikhaltsou, 2017
Nov 21)
Add a ModeChanged autocommand that has an argument indicating the old and new
mode. Also used for switching Terminal mode.
When using command line window, CmdlineLeave is triggered without
CmdlineEnter. (xtal8, 2017 Oct 30, #2263)
Add some way to get the nested state. Although CmdwinEnter is obviously
@ -271,6 +278,7 @@ The ":move" command does not honor closed folds. (Ryan Lue, #2351)
Memory leaks in test_channel? (or is it because of fork())
Memory leak in test_arabic.
Using uninitialized value in test_crypt.
Memory leaks in test_escaped_glob
Patch to clear background when "guibg=NONE" is used and 'termguicolors' is
set.
@ -1052,8 +1060,6 @@ Patch to open folds for 'incsearch'. (Christian Brabandt, 2015 Jan 6)
Patch for building a 32bit Vim with 64bit MingW compiler.
(Michael Soyka, 2014 Oct 15)
Delete old code in os_msdos.c, mch_FullName().
Patch: On MS-Windows shellescape() may have to triple double quotes.
(Ingo Karkat, 2015 Jan 16)

View File

@ -0,0 +1,16 @@
" Vim filetype plugin
" Language: CMake
" Maintainer: Keith Smiley <keithbsmiley@gmail.com>
" Last Change: 2017 Dec 24
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl commentstring<"
setlocal commentstring=#\ %s

View File

@ -2,7 +2,7 @@
" Language: MIX (Donald Knuth's assembly language used in TAOCP)
" Maintainer: Wu Yongwei <wuyongwei@gmail.com>
" Filenames: *.mixal *.mix
" Last Change: 2013 Nov 13
" Last Change: 2017-11-26 15:21:36 +0800
" Quit when a syntax file was already loaded
if exists("b:current_syntax")
@ -16,7 +16,7 @@ syn case ignore
" Special processing of ALF directive: implementations vary whether quotation
" marks are needed
syn match mixAlfParam #\s\{1,2\}"\?[^"]\{,5\}"\?# contains=mixAlfDirective,mixString nextgroup=mixEndComment contained
syn match mixAlfParam #\s\{1,2\}"\?[^"]\{,5\}"\?# contains=mixString nextgroup=mixEndComment contained
" Region for parameters
syn match mixParam #[-+*/:=0-9a-z,()"]\+# contains=mixIdentifier,mixSpecial,mixNumber,mixString,mixLabel nextgroup=mixEndComment contained
@ -46,6 +46,7 @@ syn keyword mixDirective ALF nextgroup=mixAlfParam contained
" Opcodes
syn keyword mixOpcode NOP HLT NUM CHAR FLOT FIX nextgroup=mixEndComment contained
syn keyword mixOpcode FADD FSUB FMUL FDIV FCMP MOVE ADD SUB MUL DIV IOC IN OUT JRED JBUS JMP JSJ JOV JNOV JL JE JG JLE JNE JGE SLA SRA SLAX SRAX SLC SRC nextgroup=mixParam contained skipwhite
syn keyword mixOpcode SLB SRB JAE JAO JXE JXO nextgroup=mixParam contained skipwhite
syn match mixOpcode "LD[AX1-6]N\?\>" nextgroup=mixParam contained skipwhite
syn match mixOpcode "ST[AX1-6JZ]\>" nextgroup=mixParam contained skipwhite
@ -58,7 +59,7 @@ syn match mixOpcode "J[AX1-6]N\?[NZP]\>" nextgroup=mixParam contained skipwhite
" Switch back to being case sensitive
syn case match
" Registers (only to used in comments now)
" Registers (only to be used in comments now)
syn keyword mixRegister rA rX rI1 rI2 rI3 rI4 rI5 rI6 rJ contained
" The default highlighting

View File

@ -2886,6 +2886,7 @@ f_execute(typval_T *argvars, typval_T *rettv)
int save_emsg_silent = emsg_silent;
int save_emsg_noredir = emsg_noredir;
int save_redir_execute = redir_execute;
int save_redir_off = redir_off;
garray_T save_ga;
rettv->vval.v_string = NULL;
@ -2928,6 +2929,7 @@ f_execute(typval_T *argvars, typval_T *rettv)
save_ga = redir_execute_ga;
ga_init2(&redir_execute_ga, (int)sizeof(char), 500);
redir_execute = TRUE;
redir_off = FALSE;
if (cmd != NULL)
do_cmdline_cmd(cmd);
@ -2958,6 +2960,7 @@ f_execute(typval_T *argvars, typval_T *rettv)
redir_execute = save_redir_execute;
if (redir_execute)
redir_execute_ga = save_ga;
redir_off = save_redir_off;
/* "silent reg" or "silent echo x" leaves msg_col somewhere in the
* line. Put it back in the first column. */

View File

@ -180,7 +180,7 @@ abandon_cmdline(void)
static int
empty_pattern(char_u *p)
{
int n = STRLEN(p);
size_t n = STRLEN(p);
/* remove trailing \v and the like */
while (n >= 2 && p[n - 2] == '\\'

View File

@ -3222,6 +3222,8 @@ ex_copen(exarg_T *eap)
}
else
{
int flags = 0;
qf_buf = qf_find_buf(qi);
/* The current window becomes the previous window afterwards. */
@ -3229,10 +3231,14 @@ ex_copen(exarg_T *eap)
if ((eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow)
&& cmdmod.split == 0)
/* Create the new window at the very bottom, except when
/* Create the new quickfix window at the very bottom, except when
* :belowright or :aboveleft is used. */
win_goto(lastwin);
if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL)
/* Default is to open the window below the current window */
if (cmdmod.split == 0)
flags = WSP_BELOW;
flags |= WSP_NEWLOC;
if (win_split(height, flags) == FAIL)
return; /* not enough room for window */
RESET_BINDING(curwin);

View File

@ -42,6 +42,7 @@
* a job that uses 16 colors while Vim is using > 256.
* - in GUI vertical split causes problems. Cursor is flickering. (Hirohito
* Higashi, 2017 Sep 19)
* - Trigger TerminalOpen event? #2422 patch in #2484
* - Shift-Tab does not work.
* - after resizing windows overlap. (Boris Staletic, #2164)
* - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
@ -62,6 +63,8 @@
* - add test for giving error for invalid 'termsize' value.
* - support minimal size when 'termsize' is "rows*cols".
* - support minimal size when 'termsize' is empty?
* - if the job in the terminal does not support the mouse, we can use the
* mouse in the Terminal window for copy/paste and scrolling.
* - GUI: when using tabs, focus in terminal, click on tab does not work.
* - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save
* changes to "!shell".
@ -69,8 +72,6 @@
* - Redrawing is slow with Athena and Motif. Also other GUI? (Ramel Eshed)
* - For the GUI fill termios with default values, perhaps like pangoterm:
* http://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/head:/main.c#L134
* - if the job in the terminal does not support the mouse, we can use the
* mouse in the Terminal window for copy/paste.
* - when 'encoding' is not utf-8, or the job is using another encoding, setup
* conversions.
* - In the GUI use a terminal emulator for :!cmd. Make the height the same as
@ -3385,31 +3386,39 @@ term_and_job_init(
HANDLE jo = NULL;
HANDLE child_process_handle;
HANDLE child_thread_handle;
void *winpty_err;
void *winpty_err = NULL;
void *spawn_config = NULL;
garray_T ga_cmd, ga_env;
char_u *cmd;
char_u *cmd = NULL;
if (dyn_winpty_init(TRUE) == FAIL)
return FAIL;
ga_init2(&ga_cmd, (int)sizeof(char*), 20);
ga_init2(&ga_env, (int)sizeof(char*), 20);
if (argvar->v_type == VAR_STRING)
cmd = argvar->vval.v_string;
else
{
ga_init2(&ga_cmd, (int)sizeof(char*), 20);
cmd = argvar->vval.v_string;
}
else if (argvar->v_type == VAR_LIST)
{
if (win32_build_cmd(argvar->vval.v_list, &ga_cmd) == FAIL)
goto failed;
cmd = ga_cmd.ga_data;
}
if (cmd == NULL || *cmd == NUL)
{
EMSG(_(e_invarg));
goto failed;
}
cmd_wchar = enc_to_utf16(cmd, NULL);
ga_clear(&ga_cmd);
if (cmd_wchar == NULL)
return FAIL;
goto failed;
if (opt->jo_cwd != NULL)
cwd_wchar = enc_to_utf16(opt->jo_cwd, NULL);
ga_init2(&ga_env, (int)sizeof(char*), 20);
win32_build_env(opt->jo_env, &ga_env, TRUE);
env_wchar = ga_env.ga_data;
@ -3490,6 +3499,7 @@ term_and_job_init(
winpty_spawn_config_free(spawn_config);
vim_free(cmd_wchar);
vim_free(cwd_wchar);
vim_free(env_wchar);
create_vterm(term, term->tl_rows, term->tl_cols);
@ -3511,9 +3521,8 @@ term_and_job_init(
return OK;
failed:
if (argvar->v_type == VAR_LIST)
vim_free(ga_cmd.ga_data);
vim_free(ga_env.ga_data);
ga_clear(&ga_cmd);
ga_clear(&ga_env);
vim_free(cmd_wchar);
vim_free(cwd_wchar);
if (spawn_config != NULL)

View File

@ -7,7 +7,8 @@ func Test_gf_url()
\ "first test for URL://machine.name/tmp/vimtest2a and other text",
\ "second test for URL://machine.name/tmp/vimtest2b. And other text",
\ "third test for URL:\\\\machine.name\\vimtest2c and other text",
\ "fourth test for URL:\\\\machine.name\\tmp\\vimtest2d, and other text"
\ "fourth test for URL:\\\\machine.name\\tmp\\vimtest2d, and other text",
\ "fifth test for URL://machine.name/tmp?q=vim&opt=yes and other text",
\ ])
call cursor(1,1)
call search("^first")
@ -28,6 +29,10 @@ func Test_gf_url()
call search("URL")
call assert_equal("URL:\\\\machine.name\\tmp\\vimtest2d", expand("<cfile>"))
call search("^fifth")
call search("URL")
call assert_equal("URL://machine.name/tmp?q=vim&opt=yes", expand("<cfile>"))
set isf&vim
enew!
endfunc

View File

@ -3078,3 +3078,30 @@ func Test_lvimgrep_crash()
augroup END
enew | only
endfunc
" Test for the position of the quickfix and location list window
func Test_qfwin_pos()
" Open two windows
new | only
new
cexpr ['F1:10:L10']
copen
" Quickfix window should be the bottom most window
call assert_equal(3, winnr())
close
" Open at the very top
wincmd t
topleft copen
call assert_equal(1, winnr())
close
" open left of the current window
wincmd t
below new
leftabove copen
call assert_equal(2, winnr())
close
" open right of the current window
rightbelow copen
call assert_equal(3, winnr())
close
endfunc

View File

@ -795,3 +795,14 @@ func Test_terminal_aucmd_on_close()
au! repro
delfunc Nop
endfunc
func Test_terminal_term_start_empty_command()
let cmd = "call term_start('', {'curwin' : 1, 'term_finish' : 'close'})"
call assert_fails(cmd, 'E474')
let cmd = "call term_start('', {'curwin' : 1, 'term_finish' : 'close'})"
call assert_fails(cmd, 'E474')
let cmd = "call term_start({}, {'curwin' : 1, 'term_finish' : 'close'})"
call assert_fails(cmd, 'E474')
let cmd = "call term_start(0, {'curwin' : 1, 'term_finish' : 'close'})"
call assert_fails(cmd, 'E474')
endfunc

View File

@ -206,3 +206,15 @@ func Test_CmdCompletion()
com! -complete=customlist,CustomComp DoCmd :
call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E117:')
endfunc
func CallExecute(A, L, P)
" Drop first '\n'
return execute('echo "hi"')[1:]
endfunc
func Test_use_execute_in_completion()
command! -nargs=* -complete=custom,CallExecute DoExec :
call feedkeys(":DoExec \<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"DoExec hi', @:)
delcommand DoExec
endfunc

View File

@ -771,6 +771,20 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1431,
/**/
1430,
/**/
1429,
/**/
1428,
/**/
1427,
/**/
1426,
/**/
1425,
/**/
1424,
/**/

View File

@ -6081,7 +6081,6 @@ grab_file_name(long count, linenr_T *file_lnum)
count, curbuf->b_ffname);
}
return file_name_at_cursor(options | FNAME_HYP, count, file_lnum);
}
/*
@ -6120,6 +6119,8 @@ file_name_in_line(
{
char_u *ptr;
int len;
int in_type = TRUE;
int is_url = FALSE;
/*
* search forward for what could be the start of a file name
@ -6158,8 +6159,19 @@ file_name_in_line(
*/
len = 0;
while (vim_isfilec(ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
|| ((options & FNAME_HYP) && path_is_url(ptr + len)))
|| ((options & FNAME_HYP) && path_is_url(ptr + len))
|| (is_url && vim_strchr((char_u *)"?&=", ptr[len]) != NULL))
{
/* After type:// we also include ?, & and = as valid characters, so that
* http://google.com?q=this&that=ok works. */
if ((ptr[len] >= 'A' && ptr[len] <= 'Z') || (ptr[len] >= 'a' && ptr[len] <= 'z'))
{
if (in_type && path_is_url(ptr + len + 1))
is_url = TRUE;
}
else
in_type = FALSE;
if (ptr[len] == '\\')
/* Skip over the "\" in "\ ". */
++len;

View File

@ -10,7 +10,7 @@
:: When that also fails, it uses the English version.
:: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
FOR %%d in (. %TMP% %TEMP%) DO IF EXIST %%d\nul SET TUTORCOPY=%%d\$tutor$
FOR %%d in (. "%TMP%" "%TEMP%") DO IF EXIST %%d\nul SET TUTORCOPY=%%d\$tutor$
SET xx=%1