1
0
forked from aniani/vim

updated for version 7.0056

This commit is contained in:
Bram Moolenaar
2005-03-06 23:38:09 +00:00
parent 19a09a1893
commit bc7aa85d8a
21 changed files with 1201 additions and 636 deletions

View File

@@ -320,9 +320,11 @@ getcmdline(firstc, count, indent)
switch (c)
{
case K_RIGHT: c = K_LEFT; break;
case K_XRIGHT: c = K_XLEFT; break;
case K_S_RIGHT: c = K_S_LEFT; break;
case K_C_RIGHT: c = K_C_LEFT; break;
case K_LEFT: c = K_RIGHT; break;
case K_XLEFT: c = K_XRIGHT; break;
case K_S_LEFT: c = K_S_RIGHT; break;
case K_C_LEFT: c = K_C_RIGHT; break;
}
@@ -354,10 +356,11 @@ getcmdline(firstc, count, indent)
/* free old command line when finished moving around in the history
* list */
if (lookfor != NULL
&& c != K_S_DOWN && c != K_S_UP && c != K_DOWN && c != K_UP
&& c != K_S_DOWN && c != K_S_UP
&& c != K_DOWN && c != K_UP && c != K_XDOWN && c != K_XUP
&& c != K_PAGEDOWN && c != K_PAGEUP
&& c != K_KPAGEDOWN && c != K_KPAGEUP
&& c != K_LEFT && c != K_RIGHT
&& c != K_LEFT && c != K_RIGHT && c != K_XLEFT && c != K_XRIGHT
&& (xpc.xp_numfiles > 0 || (c != Ctrl_P && c != Ctrl_N)))
{
vim_free(lookfor);
@@ -375,9 +378,9 @@ getcmdline(firstc, count, indent)
/* Special translations for 'wildmenu' */
if (did_wild_list && p_wmnu)
{
if (c == K_LEFT)
if (c == K_LEFT || c == K_XLEFT)
c = Ctrl_P;
else if (c == K_RIGHT)
else if (c == K_RIGHT || c == K_XRIGHT)
c = Ctrl_N;
}
/* Hitting CR after "emenu Name.": complete submenu */
@@ -398,7 +401,8 @@ getcmdline(firstc, count, indent)
(void)ExpandOne(&xpc, NULL, NULL, 0, WILD_FREE);
did_wild_list = FALSE;
#ifdef FEAT_WILDMENU
if (!p_wmnu || (c != K_UP && c != K_DOWN))
if (!p_wmnu || (c != K_UP && c != K_DOWN
&& c != K_XUP && c != K_XDOWN))
#endif
xpc.xp_context = EXPAND_NOTHING;
wim_index = 0;
@@ -443,9 +447,10 @@ getcmdline(firstc, count, indent)
if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu)
{
/* Hitting <Down> after "emenu Name.": complete submenu */
if (ccline.cmdbuff[ccline.cmdpos - 1] == '.' && c == K_DOWN)
if (ccline.cmdbuff[ccline.cmdpos - 1] == '.'
&& (c == K_DOWN || c == K_XDOWN))
c = p_wc;
else if (c == K_UP)
else if (c == K_UP || c == K_XUP)
{
/* Hitting <Up>: Remove one submenu name in front of the
* cursor */
@@ -492,14 +497,15 @@ getcmdline(firstc, count, indent)
upseg[4] = NUL;
if (ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP
&& c == K_DOWN
&& (c == K_DOWN || c == K_XDOWN)
&& (ccline.cmdbuff[ccline.cmdpos - 2] != '.'
|| ccline.cmdbuff[ccline.cmdpos - 3] != '.'))
{
/* go down a directory */
c = p_wc;
}
else if (STRNCMP(xpc.xp_pattern, upseg + 1, 3) == 0 && c == K_DOWN)
else if (STRNCMP(xpc.xp_pattern, upseg + 1, 3) == 0
&& (c == K_DOWN || c == K_XDOWN))
{
/* If in a direct ancestor, strip off one ../ to go down */
int found = FALSE;
@@ -527,7 +533,7 @@ getcmdline(firstc, count, indent)
c = p_wc;
}
}
else if (c == K_UP)
else if (c == K_UP || c == K_XUP)
{
/* go up a directory */
int found = FALSE;
@@ -1096,6 +1102,7 @@ getcmdline(firstc, count, indent)
continue; /* don't do incremental search now */
case K_RIGHT:
case K_XRIGHT:
case K_S_RIGHT:
case K_C_RIGHT:
do
@@ -1114,7 +1121,8 @@ getcmdline(firstc, count, indent)
#endif
++ccline.cmdpos;
}
while ((c == K_S_RIGHT || c == K_C_RIGHT)
while ((c == K_S_RIGHT || c == K_C_RIGHT
|| (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)))
&& ccline.cmdbuff[ccline.cmdpos] != ' ');
#ifdef FEAT_MBYTE
if (has_mbyte)
@@ -1123,6 +1131,7 @@ getcmdline(firstc, count, indent)
goto cmdline_not_changed;
case K_LEFT:
case K_XLEFT:
case K_S_LEFT:
case K_C_LEFT:
do
@@ -1137,7 +1146,8 @@ getcmdline(firstc, count, indent)
#endif
ccline.cmdspos -= cmdline_charsize(ccline.cmdpos);
}
while ((c == K_S_LEFT || c == K_C_LEFT)
while ((c == K_S_LEFT || c == K_C_LEFT
|| (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)))
&& ccline.cmdbuff[ccline.cmdpos - 1] != ' ');
#ifdef FEAT_MBYTE
if (has_mbyte)
@@ -1320,7 +1330,9 @@ getcmdline(firstc, count, indent)
#ifdef FEAT_CMDHIST
case K_UP:
case K_XUP:
case K_DOWN:
case K_XDOWN:
case K_S_UP:
case K_S_DOWN:
case K_PAGEUP:
@@ -1344,8 +1356,8 @@ getcmdline(firstc, count, indent)
for (;;)
{
/* one step backwards */
if (c == K_UP || c == K_S_UP || c == Ctrl_P ||
c == K_PAGEUP || c == K_KPAGEUP)
if (c == K_UP || c == K_XUP || c == K_S_UP || c == Ctrl_P
|| c == K_PAGEUP || c == K_KPAGEUP)
{
if (hiscnt == hislen) /* first time */
hiscnt = hisidx[histype];
@@ -1381,7 +1393,8 @@ getcmdline(firstc, count, indent)
hiscnt = i;
break;
}
if ((c != K_UP && c != K_DOWN) || hiscnt == i
if ((c != K_UP && c != K_DOWN && c != K_XUP && c != K_XDOWN)
|| hiscnt == i
|| STRNCMP(history[histype][hiscnt].hisstr,
lookfor, (size_t)j) == 0)
break;