Fix additional eol inserted when replace piping at end of buffer

This commit is contained in:
Maxime Coste 2015-03-06 13:57:21 +00:00
parent 2d93933d81
commit 4be6090107
4 changed files with 9 additions and 1 deletions

View File

@ -395,7 +395,8 @@ void pipe(Context& context, NormalParams)
str += '\n'; str += '\n';
str = ShellManager::instance().pipe(str, real_cmd, context, str = ShellManager::instance().pipe(str, real_cmd, context,
{}, EnvVarMap{}); {}, EnvVarMap{});
if (insert_eol and str.back() == '\n') if ((insert_eol or sel.max() == buffer.back_coord()) and
str.back() == '\n')
str = str.substr(0, str.length()-1); str = str.substr(0, str.length()-1);
strings.push_back(std::move(str)); strings.push_back(std::move(str));
} }

View File

@ -0,0 +1 @@
%|sort<ret>

View File

@ -0,0 +1,3 @@
tchou
tchaa
tchii

View File

@ -0,0 +1,3 @@
tchaa
tchii
tchou