Compare commits

..

5 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
7 changed files with 79 additions and 16 deletions

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

@ -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

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

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