mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
fixup! Use empty last line from commands working on multiple selections
We only use the last empty line when there are more than a single line break in the string to be inserted. The use-case here is having multiple carets and then running a command like “echo foo”. Here we receive “foo\n” which is split into (“foo”, “”), so every second caret would get the empty string inserted.
This commit is contained in:
@@ -1346,7 +1346,9 @@ namespace ng
|
||||
|
||||
if(inputRanges.size() > 1 && format == output_format::text && placement != output::replace_document)
|
||||
{
|
||||
std::vector<std::string> const words = text::split(out, "\n");
|
||||
std::vector<std::string> words = text::split(out, "\n");
|
||||
if(words.size() == 2 && words.back().empty())
|
||||
words.pop_back();
|
||||
|
||||
size_t i = 0;
|
||||
std::multimap<range_t, std::string> insertions;
|
||||
|
||||
Reference in New Issue
Block a user