summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-03-23 20:02:16 +1100
committerMaxime Coste <mawww@kakoune.org>2024-03-23 20:07:41 +1100
commit699c70ac91304078cdf4a8fee6d1737553f96606 (patch)
treee83a59ff972d54f9026e70c901e7c2e867d67e43 /src/buffer.cc
parent6e4bb5fbc5bc01c9143e40e3f4cb5b48efb020ec (diff)
Add some missing ScopedEdition and fix redo
tabs <-> space conversion functions did not create a ScopedEdition leading to uncommited modifications. Fixing this did fix the interactive error, but that error still existed in non interactive context so redo now considers there there is no redo child if there are uncommited modifiations (which is correct as this means we are currently creating a new leaf in the undo tree) Fixes #5124
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/buffer.cc b/src/buffer.cc
index ffb45e18..ada61ad8 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -321,11 +321,10 @@ bool Buffer::redo(size_t count)
{
throw_if_read_only();
- if (current_history_node().redo_child == HistoryId::Invalid)
+ if (current_history_node().redo_child == HistoryId::Invalid or
+ not m_current_undo_group.empty())
return false;
- kak_assert(m_current_undo_group.empty());
-
while (count-- != 0 and current_history_node().redo_child != HistoryId::Invalid)
{
m_history_id = current_history_node().redo_child;