From 7d2bae63b9e51c2952ff638ff5abce15499cd076 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 8 May 2023 22:38:22 +0200 Subject: [PATCH] Map undo selection change to / Change the initial / bindings to the recently freed-up . Pros: - easier to remember - the redo binding is logical. - works on legacy terminals, unlike Cons: - It's less convenient to toggle between selection undo and redo keys. I think this is okay since this scenario does not happen that often in practice. --- doc/pages/keys.asciidoc | 4 ++-- src/normal.cc | 4 ++-- test/normal/selection-undo/fold-redundant-entries/script | 2 +- test/normal/selection-undo/redo/script | 2 +- test/normal/selection-undo/undo/script | 2 +- test/normal/selection-undo/windisplay-hook/script | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/pages/keys.asciidoc b/doc/pages/keys.asciidoc index 2b2645aa..408e729d 100644 --- a/doc/pages/keys.asciidoc +++ b/doc/pages/keys.asciidoc @@ -308,10 +308,10 @@ Yanking (copying) and pasting use the *"* register by default (See <*:: +**:: undo last selection change -**:: +**:: redo last selection change *&*:: diff --git a/src/normal.cc b/src/normal.cc index e3220521..d53ff333 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -2340,8 +2340,8 @@ static constexpr HashMap { {'u'}, {"undo", undo} }, { {'U'}, {"redo", redo} }, - { {ctrl('h')}, {"undo selection change", undo_selection_change} }, - { {ctrl('k')}, {"redo selection change", undo_selection_change} }, + { {alt('u')}, {"undo selection change", undo_selection_change} }, + { {alt('U')}, {"redo selection change", undo_selection_change} }, { {alt('i')}, {"select inner object", select_object} }, { {alt('a')}, {"select whole object", select_object} }, diff --git a/test/normal/selection-undo/fold-redundant-entries/script b/test/normal/selection-undo/fold-redundant-entries/script index 456f92f2..3c6f905e 100644 --- a/test/normal/selection-undo/fold-redundant-entries/script +++ b/test/normal/selection-undo/fold-redundant-entries/script @@ -1,2 +1,2 @@ ui_out -ignore 4 -ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "gjgkxdihere" ] }' +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "gjgkxdihere" ] }' diff --git a/test/normal/selection-undo/redo/script b/test/normal/selection-undo/redo/script index c92d82d7..b57d219b 100644 --- a/test/normal/selection-undo/redo/script +++ b/test/normal/selection-undo/redo/script @@ -1,2 +1,2 @@ ui_out -ignore 4 -ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "2jjihere" ] }' +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "2jjihere" ] }' diff --git a/test/normal/selection-undo/undo/script b/test/normal/selection-undo/undo/script index 2b00d75e..64b1971f 100644 --- a/test/normal/selection-undo/undo/script +++ b/test/normal/selection-undo/undo/script @@ -1,2 +1,2 @@ ui_out -ignore 4 -ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "j2jihere" ] }' +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "j2jihere" ] }' diff --git a/test/normal/selection-undo/windisplay-hook/script b/test/normal/selection-undo/windisplay-hook/script index d2fd1c40..e5a5bc55 100644 --- a/test/normal/selection-undo/windisplay-hook/script +++ b/test/normal/selection-undo/windisplay-hook/script @@ -1,2 +1,2 @@ ui_out -ignore 4 -ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "j:buffer *debug*ihere" ] }' +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "j:buffer *debug*ihere" ] }'