mirror of
https://github.com/sheumann/hush.git
synced 2024-08-21 11:28:57 +00:00
vi: basic undo feature shouldn't depend on yankmark
Currently basic undo functionality with the 'u' key depends on FEATURE_VI_YANKMARK. These two features are separate, so we can remove this dependency. Signed-off-by: Andrew Fuller <abf@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
bbd53216f8
commit
4d8ddb810d
10
editors/vi.c
10
editors/vi.c
@ -3676,11 +3676,6 @@ static void do_cmd(int c)
|
|||||||
string_insert(dot, p, ALLOW_UNDO); // insert the string
|
string_insert(dot, p, ALLOW_UNDO); // insert the string
|
||||||
end_cmd_q(); // stop adding to q
|
end_cmd_q(); // stop adding to q
|
||||||
break;
|
break;
|
||||||
#if ENABLE_FEATURE_VI_UNDO
|
|
||||||
case 'u': // u- undo last operation
|
|
||||||
undo_pop();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case 'U': // U- Undo; replace current line with original version
|
case 'U': // U- Undo; replace current line with original version
|
||||||
if (reg[Ureg] != NULL) {
|
if (reg[Ureg] != NULL) {
|
||||||
p = begin_line(dot);
|
p = begin_line(dot);
|
||||||
@ -3692,6 +3687,11 @@ static void do_cmd(int c)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* FEATURE_VI_YANKMARK */
|
#endif /* FEATURE_VI_YANKMARK */
|
||||||
|
#if ENABLE_FEATURE_VI_UNDO
|
||||||
|
case 'u': // u- undo last operation
|
||||||
|
undo_pop();
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case '$': // $- goto end of line
|
case '$': // $- goto end of line
|
||||||
case KEYCODE_END: // Cursor Key End
|
case KEYCODE_END: // Cursor Key End
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
Loading…
Reference in New Issue
Block a user