mirror of
https://github.com/vim/vim.git
synced 2025-08-29 20:33:37 -04:00
updated for version 7.0056
This commit is contained in:
parent
19a09a1893
commit
bc7aa85d8a
@ -1,4 +1,4 @@
|
||||
*digraph.txt* For Vim version 7.0aa. Last change: 2004 Oct 07
|
||||
*digraph.txt* For Vim version 7.0aa. Last change: 2005 Mar 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -161,8 +161,13 @@ These are the RFC1345 digraphs for the one-byte characters. See the output of
|
||||
":digraphs" for the others. The characters above 255 are only available when
|
||||
Vim was compiled with the |+multi_byte| feature.
|
||||
|
||||
EURO
|
||||
|
||||
Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was
|
||||
added for this.
|
||||
added for this. Note the difference between latin1, where the digraph Cu is
|
||||
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
|
||||
used for the euro sign, while both of them are the character 164, 0xa4.
|
||||
|
||||
*digraph-table*
|
||||
char digraph hex dec official name ~
|
||||
^@ NU 0x00 0 NULL (NUL)
|
||||
|
@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2005 Mar 03
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2005 Mar 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -3972,6 +3972,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Number of pixel lines inserted between characters. Useful if the font
|
||||
uses the full character cell height, making lines touch each other.
|
||||
When non-zero there is room for underlining.
|
||||
With some fonts there can be too much room between lines (to have
|
||||
space for ascents and descents). Then it makes sense to set
|
||||
'linespace' to a negative value. This may cause display problems
|
||||
though!
|
||||
|
||||
*'lisp'* *'nolisp'*
|
||||
'lisp' boolean (default off)
|
||||
@ -4709,8 +4713,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'printmbcharset' 'pmbcs' string (default "")
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |+printer|
|
||||
and |+multi_byte| features}
|
||||
{only available when compiled with the |+printer|,
|
||||
|+postscript| and |+multi_byte| features}
|
||||
The CJK character set to be used for CJK output from |:hardcopy|.
|
||||
See |pmbcs-option|.
|
||||
|
||||
@ -4718,8 +4722,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'printmbfont' 'pmbfn' string (default "")
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |+printer|
|
||||
and |+multi_byte| features}
|
||||
{only available when compiled with the |+printer|,
|
||||
|+postscript| and |+multi_byte| features}
|
||||
List of font names to be used for CJK output from |:hardcopy|.
|
||||
See |pmbfn-option|.
|
||||
|
||||
@ -6344,7 +6348,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
xterm2 Works like "xterm", but with the xterm reporting the
|
||||
mouse position while the mouse is dragged. This works
|
||||
much faster and more precise. Your xterm must at
|
||||
least at patchlevel 88 / XFree 3.3.3 for this to
|
||||
least at patchlevel 88 / XFree 3.3.3 for this to
|
||||
work. See below for how Vim detects this
|
||||
automatically.
|
||||
*netterm-mouse*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 7.0aa. Last change: 2005 Mar 04
|
||||
*term.txt* For Vim version 7.0aa. Last change: 2005 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -301,6 +301,10 @@ Note: Use the <> form if possible
|
||||
t_kd <Down> arrow down *t_kd* *'t_kd'*
|
||||
t_kr <Right> arrow right *t_kr* *'t_kr'*
|
||||
t_kl <Left> arrow left *t_kl* *'t_kl'*
|
||||
<xUp> alternate arrow up *<xUp>*
|
||||
<xDown> alternate arrow down *<xDown>*
|
||||
<xRight> alternate arrow right *<xRight>*
|
||||
<xLeft> alternate arrow left *<xLeft>*
|
||||
<S-Up> shift arrow up
|
||||
<S-Down> shift arrow down
|
||||
t_%i <S-Right> shift arrow right *t_%i* *'t_%i'*
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Feb 18
|
||||
" Last Change: 2005 Mar 06
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@ -91,7 +91,7 @@ au BufNewFile,BufRead build.xml setf ant
|
||||
au BufNewFile,BufRead proftpd.conf* setf apachestyle
|
||||
|
||||
" Apache config file
|
||||
au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,.htaccess,apache.conf* setf apache
|
||||
au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,.htaccess,apache.conf*,apache2.conf*,/etc/apache2/*.conf* setf apache
|
||||
|
||||
" XA65 MOS6510 cross assembler
|
||||
au BufNewFile,BufRead *.a65 setf a65
|
||||
|
32
src/edit.c
32
src/edit.c
@ -710,9 +710,11 @@ edit(cmdchar, startln, count)
|
||||
switch (c)
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
@ -1105,7 +1107,11 @@ doESCkey:
|
||||
break;
|
||||
|
||||
case K_LEFT:
|
||||
ins_left();
|
||||
case K_XLEFT:
|
||||
if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL))
|
||||
ins_s_left();
|
||||
else
|
||||
ins_left();
|
||||
break;
|
||||
|
||||
case K_S_LEFT:
|
||||
@ -1114,7 +1120,11 @@ doESCkey:
|
||||
break;
|
||||
|
||||
case K_RIGHT:
|
||||
ins_right();
|
||||
case K_XRIGHT:
|
||||
if (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL))
|
||||
ins_s_right();
|
||||
else
|
||||
ins_right();
|
||||
break;
|
||||
|
||||
case K_S_RIGHT:
|
||||
@ -1123,7 +1133,11 @@ doESCkey:
|
||||
break;
|
||||
|
||||
case K_UP:
|
||||
ins_up(FALSE);
|
||||
case K_XUP:
|
||||
if (mod_mask & MOD_MASK_SHIFT)
|
||||
ins_pageup();
|
||||
else
|
||||
ins_up(FALSE);
|
||||
break;
|
||||
|
||||
case K_S_UP:
|
||||
@ -1133,7 +1147,11 @@ doESCkey:
|
||||
break;
|
||||
|
||||
case K_DOWN:
|
||||
ins_down(FALSE);
|
||||
case K_XDOWN:
|
||||
if (mod_mask & MOD_MASK_SHIFT)
|
||||
ins_pagedown();
|
||||
else
|
||||
ins_down(FALSE);
|
||||
break;
|
||||
|
||||
case K_S_DOWN:
|
||||
@ -6193,12 +6211,14 @@ ins_ctrl_g()
|
||||
{
|
||||
/* CTRL-G k and CTRL-G <Up>: cursor up to Insstart.col */
|
||||
case K_UP:
|
||||
case K_XUP:
|
||||
case Ctrl_K:
|
||||
case 'k': ins_up(TRUE);
|
||||
break;
|
||||
|
||||
/* CTRL-G j and CTRL-G <Down>: cursor down to Insstart.col */
|
||||
case K_DOWN:
|
||||
case K_XDOWN:
|
||||
case Ctrl_J:
|
||||
case 'j': ins_down(TRUE);
|
||||
break;
|
||||
@ -6428,6 +6448,10 @@ ins_start_select(c)
|
||||
case K_KPAGEUP:
|
||||
case K_PAGEDOWN:
|
||||
case K_KPAGEDOWN:
|
||||
case K_XLEFT:
|
||||
case K_XRIGHT:
|
||||
case K_XUP:
|
||||
case K_XDOWN:
|
||||
# ifdef MACOS
|
||||
case K_LEFT:
|
||||
case K_RIGHT:
|
||||
|
@ -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;
|
||||
|
@ -4530,6 +4530,7 @@ check_map(keys, mode, exact)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS)
|
||||
/*
|
||||
* Default mappings for some often used keys.
|
||||
*/
|
||||
@ -4609,6 +4610,7 @@ static struct initmap
|
||||
{(char_u *)"<Backspace> \"-d", VISUAL},
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* Map extra keys to their normal equivalents. */
|
||||
{(char_u *)"<xF1> <F1>", NORMAL+VISUAL+OP_PENDING},
|
||||
{(char_u *)"<xF1> <F1>", INSERT+CMDLINE},
|
||||
@ -4630,7 +4632,9 @@ static struct initmap
|
||||
{(char_u *)"<xEND> <END>", INSERT+CMDLINE},
|
||||
{(char_u *)"<xHOME> <HOME>", NORMAL+VISUAL+OP_PENDING},
|
||||
{(char_u *)"<xHOME> <HOME>", INSERT+CMDLINE},
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set up default mappings.
|
||||
@ -4638,10 +4642,12 @@ static struct initmap
|
||||
void
|
||||
init_mappings()
|
||||
{
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(initmappings) / sizeof(struct initmap); ++i)
|
||||
add_map(initmappings[i].arg, initmappings[i].mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1412,9 +1412,11 @@ EXTERN char_u e_nbreadonly[] INIT(=N_("E744: NetBeans does not allow changes in
|
||||
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO)
|
||||
EXTERN char_u e_intern2[] INIT(=N_("E685: Internal error: %s"));
|
||||
#endif
|
||||
#if 0
|
||||
#if defined(HAVE_SETJMP_H) || defined(HAVE_TRY_EXCEPT) || defined(__MINGW32__)
|
||||
EXTERN char_u e_complex[] INIT(=N_("E361: Crash intercepted; regexp too complex?"));
|
||||
#endif
|
||||
#endif
|
||||
EXTERN char_u e_outofstack[] INIT(=N_("E363: pattern caused out-of-stack error"));
|
||||
EXTERN char_u e_emptybuf[] INIT(=N_("E749: empty buffer"));
|
||||
|
||||
|
10
src/keymap.h
10
src/keymap.h
@ -207,6 +207,10 @@ enum key_extra
|
||||
, KE_XF4
|
||||
, KE_XEND /* extra (vt100) end key for xterm */
|
||||
, KE_XHOME /* extra (vt100) home key for xterm */
|
||||
, KE_XUP /* extra vt100 cursor keys for xterm */
|
||||
, KE_XDOWN
|
||||
, KE_XLEFT
|
||||
, KE_XRIGHT
|
||||
|
||||
, KE_LEFTMOUSE_NM /* non-mappable Left mouse button click */
|
||||
, KE_LEFTRELEASE_NM /* non-mappable left mouse button release */
|
||||
@ -270,6 +274,12 @@ enum key_extra
|
||||
#define K_XF3 TERMCAP2KEY(KS_EXTRA, KE_XF3)
|
||||
#define K_XF4 TERMCAP2KEY(KS_EXTRA, KE_XF4)
|
||||
|
||||
/* extra set of cursor keys for vt100 compatible xterm */
|
||||
#define K_XUP TERMCAP2KEY(KS_EXTRA, KE_XUP)
|
||||
#define K_XDOWN TERMCAP2KEY(KS_EXTRA, KE_XDOWN)
|
||||
#define K_XLEFT TERMCAP2KEY(KS_EXTRA, KE_XLEFT)
|
||||
#define K_XRIGHT TERMCAP2KEY(KS_EXTRA, KE_XRIGHT)
|
||||
|
||||
#define K_F1 TERMCAP2KEY('k', '1') /* function keys */
|
||||
#define K_F2 TERMCAP2KEY('k', '2')
|
||||
#define K_F3 TERMCAP2KEY('k', '3')
|
||||
|
@ -1953,6 +1953,7 @@ msg_puts_attr_len(str, maxlen, attr)
|
||||
case BS:
|
||||
case 'k':
|
||||
case K_UP:
|
||||
case K_XUP:
|
||||
if (!more_back_used)
|
||||
{
|
||||
msg_moremsg(TRUE);
|
||||
@ -1965,6 +1966,7 @@ msg_puts_attr_len(str, maxlen, attr)
|
||||
case NL:
|
||||
case 'j':
|
||||
case K_DOWN:
|
||||
case K_XDOWN:
|
||||
lines_left = 1;
|
||||
break;
|
||||
case ':': /* start new command line */
|
||||
|
50
src/misc2.c
50
src/misc2.c
@ -1784,6 +1784,10 @@ static struct key_name_entry
|
||||
{K_DOWN, (char_u *)"Down"},
|
||||
{K_LEFT, (char_u *)"Left"},
|
||||
{K_RIGHT, (char_u *)"Right"},
|
||||
{K_XUP, (char_u *)"xUp"},
|
||||
{K_XDOWN, (char_u *)"xDown"},
|
||||
{K_XLEFT, (char_u *)"xLeft"},
|
||||
{K_XRIGHT, (char_u *)"xRight"},
|
||||
|
||||
{K_F1, (char_u *)"F1"},
|
||||
{K_F2, (char_u *)"F2"},
|
||||
@ -1957,20 +1961,6 @@ name_to_mod_mask(c)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0 /* not used */
|
||||
/*
|
||||
* Decide whether the given key code (K_*) is a shifted special
|
||||
* key (by looking at mod_mask). If it is, then return the appropriate shifted
|
||||
* key code, otherwise just return the character as is.
|
||||
*/
|
||||
int
|
||||
check_shifted_spec_key(c)
|
||||
int c;
|
||||
{
|
||||
return simplify_key(c, &mod_mask);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check if if there is a special key code for "key" that includes the
|
||||
* modifiers specified.
|
||||
@ -2007,6 +1997,35 @@ simplify_key(key, modifiers)
|
||||
return key;
|
||||
}
|
||||
|
||||
/*
|
||||
* Change <xHome> to <Home>, <xUp> to <Up>, etc.
|
||||
* "kp" must point to an array that holds the two characters that represent a
|
||||
* special key.
|
||||
*/
|
||||
int
|
||||
handle_x_keys(key)
|
||||
int key;
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case K_XUP: return K_UP;
|
||||
case K_XDOWN: return K_DOWN;
|
||||
case K_XLEFT: return K_LEFT;
|
||||
case K_XRIGHT: return K_RIGHT;
|
||||
case K_XHOME: return K_HOME;
|
||||
case K_XEND: return K_END;
|
||||
case K_XF1: return K_F1;
|
||||
case K_XF2: return K_F2;
|
||||
case K_XF3: return K_F3;
|
||||
case K_XF4: return K_F4;
|
||||
case K_S_XF1: return K_S_F1;
|
||||
case K_S_XF2: return K_S_F2;
|
||||
case K_S_XF3: return K_S_F3;
|
||||
case K_S_XF4: return K_S_F4;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a string which contains the name of the given key when the given
|
||||
* modifiers are down.
|
||||
@ -2246,7 +2265,10 @@ find_special_key(srcp, modp, keycode)
|
||||
if (modifiers != 0 && last_dash[2] == '>')
|
||||
key = last_dash[1];
|
||||
else
|
||||
{
|
||||
key = get_special_key_code(last_dash + 1);
|
||||
key = handle_x_keys(key);
|
||||
}
|
||||
|
||||
/*
|
||||
* get_special_key_code() may return NUL for invalid
|
||||
|
75
src/normal.c
75
src/normal.c
@ -381,13 +381,17 @@ static const struct nv_cmd
|
||||
{K_KINS, nv_edit, 0, 0},
|
||||
{K_BS, nv_ctrlh, 0, 0},
|
||||
{K_UP, nv_up, NV_SSS|NV_STS, FALSE},
|
||||
{K_XUP, nv_up, NV_SSS|NV_STS, FALSE},
|
||||
{K_S_UP, nv_page, NV_SS, BACKWARD},
|
||||
{K_DOWN, nv_down, NV_SSS|NV_STS, FALSE},
|
||||
{K_XDOWN, nv_down, NV_SSS|NV_STS, FALSE},
|
||||
{K_S_DOWN, nv_page, NV_SS, FORWARD},
|
||||
{K_LEFT, nv_left, NV_SSS|NV_STS|NV_RL, 0},
|
||||
{K_XLEFT, nv_left, NV_SSS|NV_STS|NV_RL, 0},
|
||||
{K_S_LEFT, nv_bck_word, NV_SS|NV_RL, 0},
|
||||
{K_C_LEFT, nv_bck_word, NV_SSS|NV_RL|NV_STS, 1},
|
||||
{K_RIGHT, nv_right, NV_SSS|NV_STS|NV_RL, 0},
|
||||
{K_XRIGHT, nv_right, NV_SSS|NV_STS|NV_RL, 0},
|
||||
{K_S_RIGHT, nv_wordcmd, NV_SS|NV_RL, FALSE},
|
||||
{K_C_RIGHT, nv_wordcmd, NV_SSS|NV_RL|NV_STS, TRUE},
|
||||
{K_PAGEUP, nv_page, NV_SSS|NV_STS, BACKWARD},
|
||||
@ -832,10 +836,12 @@ getcount:
|
||||
{
|
||||
case 'l': ca.cmdchar = 'h'; break;
|
||||
case K_RIGHT: ca.cmdchar = K_LEFT; break;
|
||||
case K_XRIGHT: ca.cmdchar = K_XLEFT; break;
|
||||
case K_S_RIGHT: ca.cmdchar = K_S_LEFT; break;
|
||||
case K_C_RIGHT: ca.cmdchar = K_C_LEFT; break;
|
||||
case 'h': ca.cmdchar = 'l'; break;
|
||||
case K_LEFT: ca.cmdchar = K_RIGHT; break;
|
||||
case K_XLEFT: ca.cmdchar = K_XRIGHT; break;
|
||||
case K_S_LEFT: ca.cmdchar = K_S_RIGHT; break;
|
||||
case K_C_LEFT: ca.cmdchar = K_C_RIGHT; break;
|
||||
case '>': ca.cmdchar = '<'; break;
|
||||
@ -4316,7 +4322,9 @@ nv_zet(cap)
|
||||
else if (nchar == 'l'
|
||||
|| nchar == 'h'
|
||||
|| nchar == K_LEFT
|
||||
|| nchar == K_RIGHT)
|
||||
|| nchar == K_XLEFT
|
||||
|| nchar == K_RIGHT
|
||||
|| nchar == K_XRIGHT)
|
||||
{
|
||||
cap->count1 = n ? n * cap->count1 : cap->count1;
|
||||
goto dozet;
|
||||
@ -4423,6 +4431,7 @@ dozet:
|
||||
/* "zh" - scroll screen to the right */
|
||||
case 'h':
|
||||
case K_LEFT:
|
||||
case K_XLEFT:
|
||||
if (!curwin->w_p_wrap)
|
||||
{
|
||||
if ((colnr_T)cap->count1 > curwin->w_leftcol)
|
||||
@ -4440,6 +4449,7 @@ dozet:
|
||||
/* "zl" - scroll screen to the left */
|
||||
case 'l':
|
||||
case K_RIGHT:
|
||||
case K_XRIGHT:
|
||||
if (!curwin->w_p_wrap)
|
||||
{
|
||||
/* scroll the window left */
|
||||
@ -5294,6 +5304,15 @@ nv_right(cap)
|
||||
# define PAST_LINE 0
|
||||
#endif
|
||||
|
||||
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
||||
{
|
||||
/* <C-Right> and <S-Right> move a word or WORD right */
|
||||
if (mod_mask & MOD_MASK_CTRL)
|
||||
cap->arg = TRUE;
|
||||
nv_wordcmd(cap);
|
||||
return;
|
||||
}
|
||||
|
||||
cap->oap->motion_type = MCHAR;
|
||||
cap->oap->inclusive = FALSE;
|
||||
#ifdef FEAT_VISUAL
|
||||
@ -5323,7 +5342,7 @@ nv_right(cap)
|
||||
&& vim_strchr(p_ww, 's') != NULL)
|
||||
|| (cap->cmdchar == 'l'
|
||||
&& vim_strchr(p_ww, 'l') != NULL)
|
||||
|| (cap->cmdchar == K_RIGHT
|
||||
|| ((cap->cmdchar == K_RIGHT || cap->cmdchar == K_XRIGHT)
|
||||
&& vim_strchr(p_ww, '>') != NULL))
|
||||
&& curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
|
||||
{
|
||||
@ -5399,6 +5418,15 @@ nv_left(cap)
|
||||
{
|
||||
long n;
|
||||
|
||||
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
|
||||
{
|
||||
/* <C-Left> and <S-Left> move a word or WORD left */
|
||||
if (mod_mask & MOD_MASK_CTRL)
|
||||
cap->arg = 1;
|
||||
nv_bck_word(cap);
|
||||
return;
|
||||
}
|
||||
|
||||
cap->oap->motion_type = MCHAR;
|
||||
cap->oap->inclusive = FALSE;
|
||||
for (n = cap->count1; n > 0; --n)
|
||||
@ -5414,7 +5442,7 @@ nv_left(cap)
|
||||
&& vim_strchr(p_ww, 'b') != NULL)
|
||||
|| (cap->cmdchar == 'h'
|
||||
&& vim_strchr(p_ww, 'h') != NULL)
|
||||
|| (cap->cmdchar == K_LEFT
|
||||
|| ((cap->cmdchar == K_LEFT || cap->cmdchar == K_XLEFT)
|
||||
&& vim_strchr(p_ww, '<') != NULL))
|
||||
&& curwin->w_cursor.lnum > 1)
|
||||
{
|
||||
@ -5456,11 +5484,20 @@ nv_left(cap)
|
||||
nv_up(cap)
|
||||
cmdarg_T *cap;
|
||||
{
|
||||
cap->oap->motion_type = MLINE;
|
||||
if (cursor_up(cap->count1, cap->oap->op_type == OP_NOP) == FAIL)
|
||||
clearopbeep(cap->oap);
|
||||
else if (cap->arg)
|
||||
beginline(BL_WHITE | BL_FIX);
|
||||
if (mod_mask & MOD_MASK_SHIFT)
|
||||
{
|
||||
/* <S-Up> is page up */
|
||||
cap->arg = BACKWARD;
|
||||
nv_page(cap);
|
||||
}
|
||||
else
|
||||
{
|
||||
cap->oap->motion_type = MLINE;
|
||||
if (cursor_up(cap->count1, cap->oap->op_type == OP_NOP) == FAIL)
|
||||
clearopbeep(cap->oap);
|
||||
else if (cap->arg)
|
||||
beginline(BL_WHITE | BL_FIX);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -5471,6 +5508,13 @@ nv_up(cap)
|
||||
nv_down(cap)
|
||||
cmdarg_T *cap;
|
||||
{
|
||||
if (mod_mask & MOD_MASK_SHIFT)
|
||||
{
|
||||
/* <S-Down> is page down */
|
||||
cap->arg = FORWARD;
|
||||
nv_page(cap);
|
||||
}
|
||||
else
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
/* In a quickfix window a <CR> jumps to the error under the cursor. */
|
||||
if (bt_quickfix(curbuf) && cap->cmdchar == CAR)
|
||||
@ -5553,8 +5597,9 @@ nv_gotofile(cap)
|
||||
nv_end(cap)
|
||||
cmdarg_T *cap;
|
||||
{
|
||||
if (cap->arg) /* CTRL-END = goto last line */
|
||||
if (cap->arg || (mod_mask & MOD_MASK_CTRL)) /* CTRL-END = goto last line */
|
||||
{
|
||||
cap->arg = TRUE;
|
||||
nv_goto(cap);
|
||||
cap->count1 = 1; /* to end of current line */
|
||||
}
|
||||
@ -7205,6 +7250,7 @@ nv_g_cmd(cap)
|
||||
*/
|
||||
case 'j':
|
||||
case K_DOWN:
|
||||
case K_XDOWN:
|
||||
/* with 'nowrap' it works just like the normal "j" command; also when
|
||||
* in a closed fold */
|
||||
if (!curwin->w_p_wrap
|
||||
@ -7224,6 +7270,7 @@ nv_g_cmd(cap)
|
||||
|
||||
case 'k':
|
||||
case K_UP:
|
||||
case K_XUP:
|
||||
/* with 'nowrap' it works just like the normal "k" command; also when
|
||||
* in a closed fold */
|
||||
if (!curwin->w_p_wrap
|
||||
@ -7761,8 +7808,14 @@ nv_lineop(cap)
|
||||
nv_home(cap)
|
||||
cmdarg_T *cap;
|
||||
{
|
||||
cap->count0 = 1;
|
||||
nv_pipe(cap);
|
||||
/* CTRL-HOME is like "gg" */
|
||||
if (mod_mask & MOD_MASK_CTRL)
|
||||
nv_goto(cap);
|
||||
else
|
||||
{
|
||||
cap->count0 = 1;
|
||||
nv_pipe(cap);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2564,9 +2564,11 @@ Messaging_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
switch (data->dwData)
|
||||
{
|
||||
case COPYDATA_ENCODING:
|
||||
# ifdef FEAT_MBYTE
|
||||
/* Remember the encoding that the client uses. */
|
||||
vim_free(client_enc);
|
||||
client_enc = enc_canonize((char_u *)data->lpData);
|
||||
# endif
|
||||
return 1;
|
||||
|
||||
case COPYDATA_KEYS:
|
||||
|
@ -610,7 +610,13 @@ mch_delay(msec, ignoreinput)
|
||||
WaitForChar(msec);
|
||||
}
|
||||
|
||||
#if defined(HAVE_GETRLIMIT) \
|
||||
#if 0 /* disabled, no longer needed now that regmatch() is not recursive */
|
||||
# if defined(HAVE_GETRLIMIT)
|
||||
# define HAVE_STACK_LIMIT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_STACK_LIMIT) \
|
||||
|| (!defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGSTACK))
|
||||
# define HAVE_CHECK_STACK_GROWTH
|
||||
/*
|
||||
@ -638,7 +644,7 @@ check_stack_growth(p)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_GETRLIMIT) || defined(PROTO)
|
||||
#if defined(HAVE_STACK_LIMIT) || defined(PROTO)
|
||||
static char *stack_limit = NULL;
|
||||
|
||||
#if defined(_THREAD_SAFE) && defined(HAVE_PTHREAD_NP_H)
|
||||
@ -951,7 +957,7 @@ deathtrap SIGDEFARG(sigarg)
|
||||
set_vim_var_nr(VV_DYING, (long)entered);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETRLIMIT
|
||||
#ifdef HAVE_STACK_LIMIT
|
||||
/* Since we are now using the signal stack, need to reset the stack
|
||||
* limit. Otherwise using a regexp will fail. */
|
||||
get_stack_limit();
|
||||
@ -2683,12 +2689,10 @@ mch_early_init()
|
||||
{
|
||||
#ifdef HAVE_CHECK_STACK_GROWTH
|
||||
int i;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHECK_STACK_GROWTH
|
||||
check_stack_growth((char *)&i);
|
||||
|
||||
# ifdef HAVE_GETRLIMIT
|
||||
# ifdef HAVE_STACK_LIMIT
|
||||
get_stack_limit();
|
||||
# endif
|
||||
|
||||
@ -3092,7 +3096,8 @@ check_mouse_termcode()
|
||||
)
|
||||
{
|
||||
set_mouse_termcode(KS_MOUSE, (char_u *)(term_is_8bit(T_NAME)
|
||||
? IF_EB("\233M", CSI_STR "M") : IF_EB("\033[M", ESC_STR "[M")));
|
||||
? IF_EB("\233M", CSI_STR "M")
|
||||
: IF_EB("\033[M", ESC_STR "[M")));
|
||||
if (*p_mouse != NUL)
|
||||
{
|
||||
/* force mouse off and maybe on to send possibly new mouse
|
||||
@ -3128,7 +3133,7 @@ check_mouse_termcode()
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_MOUSE_NET
|
||||
/* There is no conflict, but one may type ESC } from Insert mode. Don't
|
||||
/* There is no conflict, but one may type "ESC }" from Insert mode. Don't
|
||||
* define it in the GUI or when using an xterm. */
|
||||
if (!use_xterm_mouse()
|
||||
# ifdef FEAT_GUI
|
||||
@ -3148,8 +3153,8 @@ check_mouse_termcode()
|
||||
&& !gui.in_use
|
||||
# endif
|
||||
)
|
||||
set_mouse_termcode(KS_DEC_MOUSE,
|
||||
(char_u *)IF_EB("\033[", ESC_STR "["));
|
||||
set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME)
|
||||
? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "[")));
|
||||
else
|
||||
del_mouse_termcode(KS_DEC_MOUSE);
|
||||
# endif
|
||||
|
@ -2418,6 +2418,7 @@ ex_vimgrep(eap)
|
||||
else
|
||||
{
|
||||
found_match = FALSE;
|
||||
#if 0
|
||||
#ifdef HAVE_SETJMP_H
|
||||
/*
|
||||
* Matching with a regexp may cause a very deep recursive call of
|
||||
@ -2436,6 +2437,7 @@ ex_vimgrep(eap)
|
||||
got_int = TRUE;
|
||||
goto jumpend;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
/* Try for a match in all lines of the buffer. */
|
||||
for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum)
|
||||
@ -2475,9 +2477,11 @@ ex_vimgrep(eap)
|
||||
if (got_int)
|
||||
break;
|
||||
}
|
||||
#if 0
|
||||
#ifdef HAVE_SETJMP_H
|
||||
jumpend:
|
||||
mch_endjmp();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (using_dummy)
|
||||
|
1300
src/regexp.c
1300
src/regexp.c
File diff suppressed because it is too large
Load Diff
238
src/term.c
238
src/term.c
@ -994,21 +994,21 @@ struct builtin_term builtin_termcaps[] =
|
||||
{(int)KS_CWP, IF_EB("\033[3;%d;%dt", ESC_STR "[3;%d;%dt")},
|
||||
# endif
|
||||
{(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")},
|
||||
{K_UP, IF_EB("\033OA", ESC_STR "OA")},
|
||||
{K_DOWN, IF_EB("\033OB", ESC_STR "OB")},
|
||||
{K_RIGHT, IF_EB("\033OC", ESC_STR "OC")},
|
||||
{K_LEFT, IF_EB("\033OD", ESC_STR "OD")},
|
||||
{K_S_UP, IF_EB("\033O2A", ESC_STR "O2A")},
|
||||
{K_S_DOWN, IF_EB("\033O2B", ESC_STR "O2B")},
|
||||
{K_S_RIGHT, IF_EB("\033O2C", ESC_STR "O2C")},
|
||||
{K_C_RIGHT, IF_EB("\033O5C", ESC_STR "O5C")},
|
||||
{K_S_LEFT, IF_EB("\033O2D", ESC_STR "O2D")},
|
||||
{K_C_LEFT, IF_EB("\033O5D", ESC_STR "O5D")},
|
||||
|
||||
{K_UP, IF_EB("\033O*A", ESC_STR "O*A")},
|
||||
{K_DOWN, IF_EB("\033O*B", ESC_STR "O*B")},
|
||||
{K_RIGHT, IF_EB("\033O*C", ESC_STR "O*C")},
|
||||
{K_LEFT, IF_EB("\033O*D", ESC_STR "O*D")},
|
||||
/* An extra set of cursor keys for vt100 mode */
|
||||
{K_XUP, IF_EB("\033[1;*A", ESC_STR "[1;*A")},
|
||||
{K_XDOWN, IF_EB("\033[1;*B", ESC_STR "[1;*B")},
|
||||
{K_XRIGHT, IF_EB("\033[1;*C", ESC_STR "[1;*C")},
|
||||
{K_XLEFT, IF_EB("\033[1;*D", ESC_STR "[1;*D")},
|
||||
/* An extra set of function keys for vt100 mode */
|
||||
{K_XF1, IF_EB("\033OP", ESC_STR "OP")},
|
||||
{K_XF2, IF_EB("\033OQ", ESC_STR "OQ")},
|
||||
{K_XF3, IF_EB("\033OR", ESC_STR "OR")},
|
||||
{K_XF4, IF_EB("\033OS", ESC_STR "OS")},
|
||||
{K_XF1, IF_EB("\033O*P", ESC_STR "O*P")},
|
||||
{K_XF2, IF_EB("\033O*Q", ESC_STR "O*Q")},
|
||||
{K_XF3, IF_EB("\033O*R", ESC_STR "O*R")},
|
||||
{K_XF4, IF_EB("\033O*S", ESC_STR "O*S")},
|
||||
{K_F1, IF_EB("\033[11;*~", ESC_STR "[11;*~")},
|
||||
{K_F2, IF_EB("\033[12;*~", ESC_STR "[12;*~")},
|
||||
{K_F3, IF_EB("\033[13;*~", ESC_STR "[13;*~")},
|
||||
@ -1021,32 +1021,28 @@ struct builtin_term builtin_termcaps[] =
|
||||
{K_F10, IF_EB("\033[21;*~", ESC_STR "[21;*~")},
|
||||
{K_F11, IF_EB("\033[23;*~", ESC_STR "[23;*~")},
|
||||
{K_F12, IF_EB("\033[24;*~", ESC_STR "[24;*~")},
|
||||
{K_S_XF1, IF_EB("\033O2P", ESC_STR "O2P")},
|
||||
{K_S_XF2, IF_EB("\033O2Q", ESC_STR "O2Q")},
|
||||
{K_S_XF3, IF_EB("\033O2R", ESC_STR "O2R")},
|
||||
{K_S_XF4, IF_EB("\033O2S", ESC_STR "O2S")},
|
||||
{K_S_TAB, IF_EB("\033[Z", ESC_STR "[Z")},
|
||||
{K_HELP, IF_EB("\033[28;*~", ESC_STR "[28;*~")},
|
||||
{K_UNDO, IF_EB("\033[26;*~", ESC_STR "[26;*~")},
|
||||
{K_INS, IF_EB("\033[2;*~", ESC_STR "[2;*~")},
|
||||
{K_HOME, IF_EB("\033[1;*H", ESC_STR "[1;*H")},
|
||||
{K_S_HOME, IF_EB("\033O2H", ESC_STR "O2H")},
|
||||
{K_C_HOME, IF_EB("\033O5H", ESC_STR "O5H")},
|
||||
/* {K_S_HOME, IF_EB("\033O2H", ESC_STR "O2H")}, */
|
||||
/* {K_C_HOME, IF_EB("\033O5H", ESC_STR "O5H")}, */
|
||||
{K_KHOME, IF_EB("\033[7;*~", ESC_STR "[7;*~")},
|
||||
{K_XHOME, IF_EB("\033OH", ESC_STR "OH")}, /* alternate Home */
|
||||
{K_XHOME, IF_EB("\033O*H", ESC_STR "O*H")}, /* other Home */
|
||||
{K_END, IF_EB("\033[1;*F", ESC_STR "[1;*F")},
|
||||
{K_S_END, IF_EB("\033O2F", ESC_STR "O2F")},
|
||||
{K_C_END, IF_EB("\033O5F", ESC_STR "O5F")},
|
||||
/* {K_S_END, IF_EB("\033O2F", ESC_STR "O2F")}, */
|
||||
/* {K_C_END, IF_EB("\033O5F", ESC_STR "O5F")}, */
|
||||
{K_KEND, IF_EB("\033[4;*~", ESC_STR "[4;*~")},
|
||||
{K_XEND, IF_EB("\033OF", ESC_STR "OF")}, /* alternate End */
|
||||
{K_XEND, IF_EB("\033O*F", ESC_STR "O*F")}, /* other End */
|
||||
{K_PAGEUP, IF_EB("\033[5;*~", ESC_STR "[5;*~")},
|
||||
{K_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")},
|
||||
{K_KPLUS, IF_EB("\033Ok", ESC_STR "Ok")}, /* keypad plus */
|
||||
{K_KMINUS, IF_EB("\033Om", ESC_STR "Om")}, /* keypad minus */
|
||||
{K_KDIVIDE, IF_EB("\033Oo", ESC_STR "Oo")}, /* keypad / */
|
||||
{K_KMULTIPLY, IF_EB("\033Oj", ESC_STR "Oj")}, /* keypad * */
|
||||
{K_KENTER, IF_EB("\033OM", ESC_STR "OM")}, /* keypad Enter */
|
||||
{K_KPOINT, IF_EB("\033On", ESC_STR "On")}, /* keypad . */
|
||||
{K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
|
||||
{K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */
|
||||
{K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */
|
||||
{K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */
|
||||
{K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */
|
||||
{K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
|
||||
{K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
|
||||
|
||||
{BT_EXTRA_KEYS, ""},
|
||||
@ -1286,6 +1282,10 @@ struct builtin_term builtin_termcaps[] =
|
||||
{K_DOWN, "[KD]"},
|
||||
{K_LEFT, "[KL]"},
|
||||
{K_RIGHT, "[KR]"},
|
||||
{K_XUP, "[xKU]"},
|
||||
{K_XDOWN, "[xKD]"},
|
||||
{K_XLEFT, "[xKL]"},
|
||||
{K_XRIGHT, "[xKR]"},
|
||||
{K_S_UP, "[S-KU]"},
|
||||
{K_S_DOWN, "[S-KD]"},
|
||||
{K_S_LEFT, "[S-KL]"},
|
||||
@ -1570,10 +1570,6 @@ static char *(key_names[]) =
|
||||
"#2", "#4", "%i", "*7",
|
||||
"k1", "k2", "k3", "k4", "k5", "k6",
|
||||
"k7", "k8", "k9", "k;", "F1", "F2",
|
||||
"F3", "F4", "F5", "F6", "F7", "F8",
|
||||
"F9", "FA", "FB", "FC", "FD", "FE",
|
||||
"FF", "FG", "FH", "FI", "FJ", "FK",
|
||||
"FL", "FM", "FN", "FO", "FP", "FQ", "FR",
|
||||
"%1", "&8", "kb", "kI", "kD", "kh",
|
||||
"@7", "kP", "kN", "K1", "K3", "K4", "K5", "kB",
|
||||
NULL
|
||||
@ -3497,6 +3493,8 @@ struct termcode
|
||||
static int tc_max_len = 0; /* number of entries that termcodes[] can hold */
|
||||
static int tc_len = 0; /* current number of entries in termcodes[] */
|
||||
|
||||
static int termcode_star __ARGS((char_u *code, int len));
|
||||
|
||||
void
|
||||
clear_termcodes()
|
||||
{
|
||||
@ -3516,15 +3514,19 @@ clear_termcodes()
|
||||
need_gather = TRUE; /* need to fill termleader[] */
|
||||
}
|
||||
|
||||
#define ATC_FROM_TERM 55
|
||||
|
||||
/*
|
||||
* Add a new entry to the list of terminal codes.
|
||||
* The list is kept alphabetical for ":set termcap"
|
||||
* "flags" is TRUE when replacing 7-bit by 8-bit controls is desired.
|
||||
* "flags" can also be ATC_FROM_TERM for got_code_from_term().
|
||||
*/
|
||||
void
|
||||
add_termcode(name, string, use_8bit)
|
||||
add_termcode(name, string, flags)
|
||||
char_u *name;
|
||||
char_u *string;
|
||||
int use_8bit; /* replace 7-bit control by 8-bit one */
|
||||
int flags;
|
||||
{
|
||||
struct termcode *new_tc;
|
||||
int i, j;
|
||||
@ -3542,7 +3544,7 @@ add_termcode(name, string, use_8bit)
|
||||
return;
|
||||
|
||||
/* Change leading <Esc>[ to CSI, change <Esc>O to <M-O>. */
|
||||
if (use_8bit && term_7to8bit(string) != 0)
|
||||
if (flags != 0 && flags != ATC_FROM_TERM && term_7to8bit(string) != 0)
|
||||
{
|
||||
mch_memmove(s, s + 1, STRLEN(s));
|
||||
s[0] = term_7to8bit(string);
|
||||
@ -3584,26 +3586,28 @@ add_termcode(name, string, use_8bit)
|
||||
if (termcodes[i].name[1] < name[1])
|
||||
continue;
|
||||
/*
|
||||
* Exact match: Replace old code.
|
||||
* But don't replace ESC[123;*X with another.
|
||||
* Exact match: May replace old code.
|
||||
*/
|
||||
if (termcodes[i].name[1] == name[1])
|
||||
{
|
||||
if (termcodes[i].len >= 4
|
||||
&& STRNCMP(termcodes[i].code + termcodes[i].len - 3,
|
||||
";*", 2) == 0)
|
||||
if (flags == ATC_FROM_TERM && (j = termcode_star(
|
||||
termcodes[i].code, termcodes[i].len)) > 0)
|
||||
{
|
||||
/* if they are equal but for the ";*" don't add it */
|
||||
if (len == termcodes[i].len - 2
|
||||
/* Don't replace ESC[123;*X or ESC O*X with another when
|
||||
* invoked from got_code_from_term(). */
|
||||
if (len == termcodes[i].len - j
|
||||
&& STRNCMP(s, termcodes[i].code, len - 1) == 0
|
||||
&& s[len - 1] == termcodes[i].code[len + 1])
|
||||
&& s[len - 1]
|
||||
== termcodes[i].code[termcodes[i].len - 1])
|
||||
{
|
||||
/* They are equal but for the ";*": don't add it. */
|
||||
vim_free(s);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Replace old code. */
|
||||
vim_free(termcodes[i].code);
|
||||
--tc_len;
|
||||
break;
|
||||
@ -3622,14 +3626,37 @@ add_termcode(name, string, use_8bit)
|
||||
termcodes[i].name[1] = name[1];
|
||||
termcodes[i].code = s;
|
||||
termcodes[i].len = len;
|
||||
/* recognize special code like "ESC[42;*X" that accepts modifiers */
|
||||
if (len >= 5 && STRNCMP(s + len - 3, ";*", 2) == 0)
|
||||
termcodes[i].modlen = len - 3;
|
||||
else
|
||||
termcodes[i].modlen = 0;
|
||||
|
||||
/* For xterm we recognize special codes like "ESC[42;*X" and "ESC O*X" that
|
||||
* accept modifiers. */
|
||||
termcodes[i].modlen = 0;
|
||||
j = termcode_star(s, len);
|
||||
if (j > 0)
|
||||
termcodes[i].modlen = len - 1 - j;
|
||||
++tc_len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check termcode "code[len]" for ending in ;*X, <Esc>O*X or <M-O>*X.
|
||||
* The "X" can be any character.
|
||||
* Return 0 if not found, 2 for ;*X and 1 for O*X and <M-O>*X.
|
||||
*/
|
||||
static int
|
||||
termcode_star(code, len)
|
||||
char_u *code;
|
||||
int len;
|
||||
{
|
||||
/* Shortest is <M-O>*X. With ; shortest is <CSI>1;*X */
|
||||
if (len >= 3 && code[len - 2] == '*')
|
||||
{
|
||||
if (len >= 5 && code[len - 3] == ';')
|
||||
return 2;
|
||||
if ((len >= 4 && code[len - 3] == 'O') || code[len - 3] == 'O' + 128)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
char_u *
|
||||
find_termcode(name)
|
||||
char_u *name;
|
||||
@ -3762,9 +3789,12 @@ check_termcode(max_offset, buf, buflen)
|
||||
char_u *tp;
|
||||
char_u *p;
|
||||
int slen = 0; /* init for GCC */
|
||||
int modslen;
|
||||
int len;
|
||||
int offset;
|
||||
char_u key_name[2];
|
||||
int modifiers;
|
||||
int key;
|
||||
int new_slen;
|
||||
int extra;
|
||||
char_u string[MAX_KEY_CODE_LEN + 1];
|
||||
@ -3776,7 +3806,6 @@ check_termcode(max_offset, buf, buflen)
|
||||
int num_bytes;
|
||||
# endif
|
||||
int mouse_code = 0; /* init for GCC */
|
||||
int modifiers;
|
||||
int is_click, is_drag;
|
||||
int wheel_code = 0;
|
||||
int current_button;
|
||||
@ -3859,8 +3888,8 @@ check_termcode(max_offset, buf, buflen)
|
||||
if (*tp == ESC && !p_ek && (State & INSERT))
|
||||
continue;
|
||||
|
||||
new_slen = 0; /* Length of what will replace the termcode */
|
||||
key_name[0] = NUL; /* no key name found yet */
|
||||
modifiers = 0; /* no modifiers yet */
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use)
|
||||
@ -3918,69 +3947,60 @@ check_termcode(max_offset, buf, buflen)
|
||||
|
||||
key_name[0] = termcodes[idx].name[0];
|
||||
key_name[1] = termcodes[idx].name[1];
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for code with modifier, like xterm uses:
|
||||
* ESC[123;2X (shift) ESC[123;3X (alt), etc.
|
||||
* <Esc>[123;*X (modslen == slen - 3)
|
||||
* Also <Esc>O*X and <M-O>*X (modslen == slen - 2).
|
||||
* When there is a modifier the * matches a number.
|
||||
* When there is no modifier the ;* or * is omitted.
|
||||
*/
|
||||
if (termcodes[idx].modlen > 0)
|
||||
{
|
||||
slen = termcodes[idx].modlen;
|
||||
if (cpo_koffset && offset && len < slen)
|
||||
modslen = termcodes[idx].modlen;
|
||||
if (cpo_koffset && offset && len < modslen)
|
||||
continue;
|
||||
if (STRNCMP(termcodes[idx].code, tp,
|
||||
(size_t)(slen > len ? len : slen)) == 0)
|
||||
(size_t)(modslen > len ? len : modslen)) == 0)
|
||||
{
|
||||
int n;
|
||||
int mod;
|
||||
|
||||
if (len <= slen) /* got a partial sequence */
|
||||
if (len <= modslen) /* got a partial sequence */
|
||||
return -1; /* need to get more chars */
|
||||
|
||||
if (tp[slen] == termcodes[idx].code[slen + 2])
|
||||
++slen; /* no modifiers */
|
||||
else if (tp[slen] != ';')
|
||||
if (tp[modslen] == termcodes[idx].code[slen - 1])
|
||||
slen = modslen + 1; /* no modifiers */
|
||||
else if (tp[modslen] != ';' && modslen == slen - 3)
|
||||
continue; /* no match */
|
||||
else
|
||||
{
|
||||
/* Skip over the digits, the final char must
|
||||
* follow. */
|
||||
for (j = slen + 1; j < len && isdigit(tp[j]); ++j)
|
||||
for (j = slen - 2; j < len && isdigit(tp[j]); ++j)
|
||||
;
|
||||
++j;
|
||||
if (len < j) /* got a partial sequence */
|
||||
return -1; /* need to get more chars */
|
||||
if (tp[j - 1] != termcodes[idx].code[slen + 2])
|
||||
continue;
|
||||
if (tp[j - 1] != termcodes[idx].code[slen - 1])
|
||||
continue; /* no match */
|
||||
|
||||
/* Match! Convert modifier bits. */
|
||||
n = atoi((char *)tp + slen + 1) - 1;
|
||||
mod = 0x0;
|
||||
n = atoi((char *)tp + slen - 2) - 1;
|
||||
if (n & 1)
|
||||
mod |= MOD_MASK_SHIFT;
|
||||
modifiers |= MOD_MASK_SHIFT;
|
||||
if (n & 2)
|
||||
mod |= MOD_MASK_ALT;
|
||||
modifiers |= MOD_MASK_ALT;
|
||||
if (n & 4)
|
||||
mod |= MOD_MASK_CTRL;
|
||||
modifiers |= MOD_MASK_CTRL;
|
||||
if (n & 8)
|
||||
mod |= MOD_MASK_META;
|
||||
|
||||
/* Add the modifier codes to our string */
|
||||
if (mod != 0)
|
||||
{
|
||||
string[new_slen++] = K_SPECIAL;
|
||||
string[new_slen++] = (int)KS_MODIFIER;
|
||||
string[new_slen++] = mod;
|
||||
}
|
||||
modifiers |= MOD_MASK_META;
|
||||
|
||||
slen = j;
|
||||
}
|
||||
key_name[0] = termcodes[idx].name[0];
|
||||
key_name[1] = termcodes[idx].name[1];
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4672,7 +4692,6 @@ check_termcode(max_offset, buf, buflen)
|
||||
* Translate the actual mouse event into a pseudo mouse event.
|
||||
* First work out what modifiers are to be used.
|
||||
*/
|
||||
modifiers = 0x0;
|
||||
if (orig_mouse_code & MOUSE_SHIFT)
|
||||
modifiers |= MOD_MASK_SHIFT;
|
||||
if (orig_mouse_code & MOUSE_CTRL)
|
||||
@ -4686,14 +4705,6 @@ check_termcode(max_offset, buf, buflen)
|
||||
else if (orig_num_clicks == 4)
|
||||
modifiers |= MOD_MASK_4CLICK;
|
||||
|
||||
/* Add the modifier codes to our string */
|
||||
if (modifiers != 0)
|
||||
{
|
||||
string[new_slen++] = K_SPECIAL;
|
||||
string[new_slen++] = (int)KS_MODIFIER;
|
||||
string[new_slen++] = modifiers;
|
||||
}
|
||||
|
||||
/* Work out our pseudo mouse event */
|
||||
key_name[0] = (int)KS_EXTRA;
|
||||
if (wheel_code != 0)
|
||||
@ -4785,7 +4796,31 @@ check_termcode(max_offset, buf, buflen)
|
||||
# endif /* !USE_ON_FLY_SCROLL */
|
||||
#endif /* FEAT_GUI */
|
||||
|
||||
/*
|
||||
* Change <xHome> to <Home>, <xUp> to <Up>, etc.
|
||||
*/
|
||||
key = handle_x_keys(TERMCAP2KEY(key_name[0], key_name[1]));
|
||||
|
||||
/*
|
||||
* Add any modifier codes to our string.
|
||||
*/
|
||||
new_slen = 0; /* Length of what will replace the termcode */
|
||||
if (modifiers != 0)
|
||||
{
|
||||
/* Some keys have the modifier included. Need to handle that here
|
||||
* to make mappings work. */
|
||||
key = simplify_key(key, &modifiers);
|
||||
if (modifiers != 0)
|
||||
{
|
||||
string[new_slen++] = K_SPECIAL;
|
||||
string[new_slen++] = (int)KS_MODIFIER;
|
||||
string[new_slen++] = modifiers;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally, add the special key code to our string */
|
||||
key_name[0] = KEY2TERMCAP0(key);
|
||||
key_name[1] = KEY2TERMCAP1(key);
|
||||
if (key_name[0] == KS_KEY)
|
||||
string[new_slen++] = key_name[1]; /* from ":set <M-b>=xx" */
|
||||
else
|
||||
@ -5124,7 +5159,8 @@ show_termcodes()
|
||||
int i;
|
||||
int len;
|
||||
|
||||
#define INC 27 /* try to make three columns */
|
||||
#define INC3 27 /* try to make three columns */
|
||||
#define INC2 40 /* try to make two columns */
|
||||
#define GAP 2 /* spaces between columns */
|
||||
|
||||
if (tc_len == 0) /* no terminal codes (must be GUI) */
|
||||
@ -5139,9 +5175,10 @@ show_termcodes()
|
||||
/*
|
||||
* do the loop two times:
|
||||
* 1. display the short items (non-strings and short strings)
|
||||
* 2. display the long items (strings)
|
||||
* 2. display the medium items (medium length strings)
|
||||
* 3. display the long items (remaining strings)
|
||||
*/
|
||||
for (run = 1; run <= 2 && !got_int; ++run)
|
||||
for (run = 1; run <= 3 && !got_int; ++run)
|
||||
{
|
||||
/*
|
||||
* collect the items in items[]
|
||||
@ -5151,21 +5188,23 @@ show_termcodes()
|
||||
{
|
||||
len = show_one_termcode(termcodes[i].name,
|
||||
termcodes[i].code, FALSE);
|
||||
if ((len <= INC - GAP && run == 1) || (len > INC - GAP && run == 2))
|
||||
if (len <= INC3 - GAP ? run == 1
|
||||
: len <= INC2 - GAP ? run == 2
|
||||
: run == 3)
|
||||
items[item_count++] = i;
|
||||
}
|
||||
|
||||
/*
|
||||
* display the items
|
||||
*/
|
||||
if (run == 1)
|
||||
if (run <= 2)
|
||||
{
|
||||
cols = (Columns + GAP) / INC;
|
||||
cols = (Columns + GAP) / (run == 1 ? INC3 : INC2);
|
||||
if (cols == 0)
|
||||
cols = 1;
|
||||
rows = (item_count + cols - 1) / cols;
|
||||
}
|
||||
else /* run == 2 */
|
||||
else /* run == 3 */
|
||||
rows = item_count;
|
||||
for (row = 0; row < rows && !got_int; ++row)
|
||||
{
|
||||
@ -5178,7 +5217,10 @@ show_termcodes()
|
||||
msg_col = col; /* make columns */
|
||||
show_one_termcode(termcodes[items[i]].name,
|
||||
termcodes[items[i]].code, TRUE);
|
||||
col += INC;
|
||||
if (run == 2)
|
||||
col += INC2;
|
||||
else
|
||||
col += INC3;
|
||||
}
|
||||
out_flush();
|
||||
ui_breakcheck();
|
||||
@ -5343,7 +5385,7 @@ got_code_from_term(code, len)
|
||||
i = find_term_bykeys(str);
|
||||
if (i >= 0)
|
||||
del_termcode_idx(i);
|
||||
add_termcode(name, str, FALSE);
|
||||
add_termcode(name, str, ATC_FROM_TERM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
@ -20,3 +20,8 @@ test text test text [\u-z]
|
||||
xx xx a
|
||||
xx aaaaa xx a
|
||||
xx aaaaa xx a
|
||||
xx Aaa xx
|
||||
xx Aaaa xx
|
||||
xx Aaa xx
|
||||
xx foobar xA xx
|
||||
xx an A xx
|
||||
|
@ -36,5 +36,5 @@
|
||||
#define VIM_VERSION_NODOT "vim70aa"
|
||||
#define VIM_VERSION_SHORT "7.0aa"
|
||||
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
|
||||
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 4)"
|
||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 4, compiled "
|
||||
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 7)"
|
||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Mar 7, compiled "
|
||||
|
@ -263,6 +263,7 @@ do_window(nchar, Prenum, xchar)
|
||||
/* cursor to window below */
|
||||
case 'j':
|
||||
case K_DOWN:
|
||||
case K_XDOWN:
|
||||
case Ctrl_J:
|
||||
CHECK_CMDWIN
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
@ -278,6 +279,7 @@ do_window(nchar, Prenum, xchar)
|
||||
/* cursor to window above */
|
||||
case 'k':
|
||||
case K_UP:
|
||||
case K_XUP:
|
||||
case Ctrl_K:
|
||||
CHECK_CMDWIN
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
@ -294,6 +296,7 @@ do_window(nchar, Prenum, xchar)
|
||||
/* cursor to left window */
|
||||
case 'h':
|
||||
case K_LEFT:
|
||||
case K_XLEFT:
|
||||
case Ctrl_H:
|
||||
case K_BS:
|
||||
CHECK_CMDWIN
|
||||
@ -303,6 +306,7 @@ do_window(nchar, Prenum, xchar)
|
||||
/* cursor to right window */
|
||||
case 'l':
|
||||
case K_RIGHT:
|
||||
case K_XRIGHT:
|
||||
case Ctrl_L:
|
||||
CHECK_CMDWIN
|
||||
win_goto_hor(FALSE, Prenum1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user