summaryrefslogtreecommitdiff
path: root/find.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-10 10:55:51 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-11 14:50:02 -0500
commit5bffb50207f8d8ba873f4c40dde4859179153001 (patch)
tree6d1c574838b94273af4021b0a5453a3948c85887 /find.c
parent4f2a012a5dbad755bd621a3308a306afd4589fd5 (diff)
chain replace all into one undo event
Diffstat (limited to 'find.c')
-rw-r--r--find.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/find.c b/find.c
index 48a9299..805210a 100644
--- a/find.c
+++ b/find.c
@@ -272,11 +272,13 @@ static void find_replace_all(Ted *ted) {
FindResult *last_result = arr_lastp(ted->find_results);
buffer_cursor_move_to_pos(buffer, last_result->start);
}
+ buffer_start_edit_chain(buffer);
// NOTE: we don't need to increment i because the matches will be removed from the find_results array.
for (u32 i = match_idx; i < arr_len(ted->find_results); ) {
if (!find_replace_match(ted, i))
break;
}
+ buffer_end_edit_chain(buffer);
find_update(ted, true);
}
}