summaryrefslogtreecommitdiff
path: root/src/context.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-01-28 08:29:41 +1100
committerMaxime Coste <mawww@kakoune.org>2023-01-28 08:29:41 +1100
commitd5ae08498c529e8bfb22e0aaae7fee993d1e05ab (patch)
tree25d7e6849b620aa78c4b7f845cfc3ca61c5dac72 /src/context.hh
parent6b7ed51be1e8c18898c43b4cf6075c5e1d27364c (diff)
parent516759bb2fd95d02134bc84130bf9060e0354310 (diff)
Merge remote-tracking branch 'krobelus/selection-undo-fix-standstill-after-buffer-change'
Diffstat (limited to 'src/context.hh')
-rw-r--r--src/context.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/context.hh b/src/context.hh
index 3fe28dc2..34bb9e12 100644
--- a/src/context.hh
+++ b/src/context.hh
@@ -19,6 +19,8 @@ class DisplayLine;
class KeymapManager;
class AliasRegistry;
+enum Direction { Backward = -1, Forward = 1 };
+
struct JumpList
{
void push(SelectionList jump, Optional<size_t> index = {});
@@ -91,8 +93,8 @@ public:
SelectionList& selections_write_only();
void end_selection_edition() { m_selection_history.end_edition(); }
+ template<Direction direction>
void undo_selection_change();
- void redo_selection_change();
void change_buffer(Buffer& buffer, Optional<FunctionRef<void()>> set_selection = {});
void forget_buffer(Buffer& buffer);
@@ -169,8 +171,8 @@ private:
void end_edition();
bool in_edition() const { return m_in_edition; }
+ template<Direction direction>
void undo();
- void redo();
void forget_buffer(Buffer& buffer);
private:
enum class HistoryId : size_t { First = 0, Invalid = (size_t)-1 };