Make up/down cursor move up or down when in multiline mode, except if already in search mode or at the top/bottom line. Since part of this is done in script-space, this involves adding some functionality to the commandline builtin.

darcs-hash:20070921140549-75c98-ba9e83f5e6fdecae5df8f83dd863794c6af9770c.gz
This commit is contained in:
liljencrantz
2007-09-22 00:05:49 +10:00
parent 607e970659
commit d2d397d9eb
9 changed files with 308 additions and 29 deletions

16
input.c
View File

@@ -134,7 +134,9 @@ static const wchar_t *name_arr[] =
L"execute",
L"beginning-of-buffer",
L"end-of-buffer",
L"repaint"
L"repaint",
L"up-line",
L"down-line"
}
;
@@ -215,7 +217,9 @@ static const wchar_t code_arr[] =
R_EXECUTE,
R_BEGINNING_OF_BUFFER,
R_END_OF_BUFFER,
R_REPAINT
R_REPAINT,
R_UP_LINE,
R_DOWN_LINE
}
;
@@ -1242,10 +1246,10 @@ static void add_common_bindings()
terminfo sometimes specifies a different sequence than what
keypresses actually generate
*/
add_mapping( name[i], L"\x1b[A", L"Up", L"history-search-backward" );
add_mapping( name[i], L"\x1b[B", L"Down", L"history-search-forward" );
add_terminfo_mapping( name[i], (key_up), L"Up", L"history-search-backward" );
add_terminfo_mapping( name[i], (key_down), L"Down", L"history-search-forward" );
add_mapping( name[i], L"\x1b[A", L"Up", L"up-or-search" );
add_mapping( name[i], L"\x1b[B", L"Down", L"down-or-search" );
add_terminfo_mapping( name[i], (key_up), L"Up", L"up-or-search" );
add_terminfo_mapping( name[i], (key_down), L"Down", L"down-or-search" );
add_mapping( name[i], L"\x1b[C", L"Right", L"forward-char" );
add_mapping( name[i], L"\x1b[D", L"Left", L"backward-char" );