0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

updated for version 7.4.572

Problem:    Address type of :wincmd depends on the argument.
Solution:   Check the argument.
This commit is contained in:
Bram Moolenaar
2015-01-14 15:47:36 +01:00
parent 435797304a
commit 84c8e5ab9c
4 changed files with 135 additions and 23 deletions

View File

@@ -624,6 +624,110 @@ wingotofile:
}
}
/*
* Figure out the address type for ":wnncmd".
*/
void
get_wincmd_addr_type(arg, eap)
char_u *arg;
exarg_T *eap;
{
switch (*arg)
{
case 'S':
case Ctrl_S:
case 's':
case Ctrl_N:
case 'n':
case 'j':
case Ctrl_J:
case 'k':
case Ctrl_K:
case 'T':
case Ctrl_R:
case 'r':
case 'R':
case 'K':
case 'J':
case '+':
case '-':
case Ctrl__:
case '_':
case '|':
case ']':
case Ctrl_RSB:
case 'g':
case Ctrl_G:
#ifdef FEAT_VERTSPLIT
case Ctrl_V:
case 'v':
case 'h':
case Ctrl_H:
case 'l':
case Ctrl_L:
case 'H':
case 'L':
case '>':
case '<':
#endif
#if defined(FEAT_QUICKFIX)
case '}':
#endif
#ifdef FEAT_SEARCHPATH
case 'f':
case 'F':
case Ctrl_F:
#endif
#ifdef FEAT_FIND_ID
case 'i':
case Ctrl_I:
case 'd':
case Ctrl_D:
#endif
/* window size or any count */
eap->addr_type = ADDR_LINES;
break;
case Ctrl_HAT:
case '^':
/* buffer number */
eap->addr_type = ADDR_BUFFERS;
break;
case Ctrl_Q:
case 'q':
case Ctrl_C:
case 'c':
case Ctrl_O:
case 'o':
case Ctrl_W:
case 'w':
case 'W':
case 'x':
case Ctrl_X:
/* window number */
eap->addr_type = ADDR_WINDOWS;
break;
#if defined(FEAT_QUICKFIX)
case Ctrl_Z:
case 'z':
case 'P':
#endif
case 't':
case Ctrl_T:
case 'b':
case Ctrl_B:
case 'p':
case Ctrl_P:
case '=':
case CAR:
/* no count */
eap->addr_type = 0;
break;
}
}
static void
cmd_with_count(cmd, bufp, bufsize, Prenum)
char *cmd;