Fix invalid line joining logic with multiple selection per line
Fixes #4476
This commit is contained in:
parent
92f7306d5b
commit
f68e8313b2
|
@ -1104,6 +1104,7 @@ void join_lines_select_spaces(Context& context, NormalParams)
|
||||||
if (selections.empty())
|
if (selections.empty())
|
||||||
return;
|
return;
|
||||||
context.selections_write_only() = std::move(selections);
|
context.selections_write_only() = std::move(selections);
|
||||||
|
context.selections().merge_consecutive();
|
||||||
ScopedEdition edition(context);
|
ScopedEdition edition(context);
|
||||||
context.selections().replace({" "_str});
|
context.selections().replace({" "_str});
|
||||||
}
|
}
|
||||||
|
|
1
test/regression/4476-invalid-line-join/cmd
Normal file
1
test/regression/4476-invalid-line-join/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
%<a-s><a-S><a-j>
|
2
test/regression/4476-invalid-line-join/in
Normal file
2
test/regression/4476-invalid-line-join/in
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
ab
|
||||||
|
ac
|
1
test/regression/4476-invalid-line-join/out
Normal file
1
test/regression/4476-invalid-line-join/out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ab ac
|
Loading…
Reference in New Issue
Block a user