diff --git a/src/input_handler.cc b/src/input_handler.cc index b543a268..71a5d63f 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -979,7 +979,7 @@ private: kak_assert(false); // invalid for interactive insert break; } - if (mode != InsertMode::Append) + if (mode != InsertMode::Append and mode != InsertMode::Replace) selections.sort_and_merge_overlapping(); selections.check_invariant(); buffer.check_invariant(); diff --git a/test/unit/insert-replace/cmd b/test/unit/insert-replace/cmd new file mode 100644 index 00000000..daa37b38 --- /dev/null +++ b/test/unit/insert-replace/cmd @@ -0,0 +1 @@ +cthis was " diff --git a/test/unit/insert-replace/in b/test/unit/insert-replace/in new file mode 100644 index 00000000..546219dd --- /dev/null +++ b/test/unit/insert-replace/in @@ -0,0 +1 @@ +%(word1)%(word2)%(word3)%(word4) diff --git a/test/unit/insert-replace/out b/test/unit/insert-replace/out new file mode 100644 index 00000000..fae360dd --- /dev/null +++ b/test/unit/insert-replace/out @@ -0,0 +1 @@ +this was word1 this was word2 this was word3 this was word4