Skip to content

Commit f5a5116

Browse files
committed
patch 8.2.2469: confusing error if :winsize has a wrong argument
Problem: Confusing error if :winsize has a wrong argument. Solution: Quote the argument in the error. (closes #2523)
1 parent 038e09e commit f5a5116

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/ex_docmd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7347,6 +7347,11 @@ ex_winsize(exarg_T *eap)
73477347
char_u *arg = eap->arg;
73487348
char_u *p;
73497349

7350+
if (!isdigit(*arg))
7351+
{
7352+
semsg(_(e_invarg2), arg);
7353+
return;
7354+
}
73507355
w = getdigits(&arg);
73517356
arg = skipwhite(arg);
73527357
p = arg;

src/testdir/test_excmd.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ endfunc
327327
" Test for the :winsize command
328328
func Test_winsize_cmd()
329329
call assert_fails('winsize 1', 'E465:')
330+
call assert_fails('winsize 1 x', 'E465:')
331+
call assert_fails('win_getid(1)', 'E475: Invalid argument: _getid(1)')
332+
" Actually changing the window size would be flaky.
330333
endfunc
331334

332335
" Test for the :redir command

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2469,
753755
/**/
754756
2468,
755757
/**/

0 commit comments

Comments
 (0)