From 7d2bae63b9e51c2952ff638ff5abce15499cd076 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 8 May 2023 22:38:22 +0200 Subject: [PATCH 1/2] 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" ] }' From 2308a178339474ed8c3ba88053abf602460ed3b6 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 8 May 2023 22:46:19 +0200 Subject: [PATCH 2/2] Update changelog for selection undo --- doc/pages/changelog.asciidoc | 6 ++++++ src/main.cc | 1 + 2 files changed, 7 insertions(+) diff --git a/doc/pages/changelog.asciidoc b/doc/pages/changelog.asciidoc index 58b090da..cb92aed9 100644 --- a/doc/pages/changelog.asciidoc +++ b/doc/pages/changelog.asciidoc @@ -3,6 +3,12 @@ This changelog contains major and/or breaking changes to Kakoune between released versions. +== Development version + +* History is now stored linearly instead of in a tree +* `` and `` now undo selection history +* `%exp{...}` expansions provide flexible quoting for expanded strings (as double quoted strings) + == Kakoune 2022.10.31 * `complete-command` (See <>) diff --git a/src/main.cc b/src/main.cc index b64b14d6..609fea47 100644 --- a/src/main.cc +++ b/src/main.cc @@ -46,6 +46,7 @@ struct { } constexpr version_notes[] = { { 0, "» History is now stored linearly instead of in a tree\n" + "» {+b}{} and {+b}{} now undo selection history\n" "» {+u}%exp\\{...}{} expansions provide flexible quoting for expanded " "strings (as double quoted strings)\n" }, {