0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.0.0086

Problem:    Cannot add a comment after ":hide". (Norio Takagi)
Solution:   Make it work, add a test. (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2016-11-15 21:17:07 +01:00
parent 8a01f969c1
commit 2256c99471
6 changed files with 127 additions and 31 deletions

View File

@@ -5632,15 +5632,16 @@ find_nextcmd(char_u *p)
#endif
/*
* Check if *p is a separator between Ex commands.
* Return NULL if it isn't, (p + 1) if it is.
* Check if *p is a separator between Ex commands, skipping over white space.
* Return NULL if it isn't, the following character if it is.
*/
char_u *
check_nextcmd(char_u *p)
{
p = skipwhite(p);
if (*p == '|' || *p == '\n')
return (p + 1);
char_u *s = skipwhite(p);
if (*s == '|' || *s == '\n')
return (s + 1);
else
return NULL;
}
@@ -7572,38 +7573,32 @@ ex_all(exarg_T *eap)
static void
ex_hide(exarg_T *eap)
{
if (*eap->arg != NUL && check_nextcmd(eap->arg) == NULL)
eap->errmsg = e_invarg;
else
{
/* ":hide" or ":hide | cmd": hide current window */
eap->nextcmd = check_nextcmd(eap->arg);
/* ":hide" or ":hide | cmd": hide current window */
#ifdef FEAT_WINDOWS
if (!eap->skip)
{
if (!eap->skip)
{
# ifdef FEAT_GUI
need_mouse_correct = TRUE;
need_mouse_correct = TRUE;
# endif
if (eap->addr_count == 0)
win_close(curwin, FALSE); /* don't free buffer */
else
{
int winnr = 0;
win_T *win;
if (eap->addr_count == 0)
win_close(curwin, FALSE); /* don't free buffer */
else
{
int winnr = 0;
win_T *win;
FOR_ALL_WINDOWS(win)
{
winnr++;
if (winnr == eap->line2)
break;
}
if (win == NULL)
win = lastwin;
win_close(win, FALSE);
FOR_ALL_WINDOWS(win)
{
winnr++;
if (winnr == eap->line2)
break;
}
if (win == NULL)
win = lastwin;
win_close(win, FALSE);
}
#endif
}
#endif
}
/*