Fix additional eol inserted when replace piping at end of buffer
This commit is contained in:
parent
2d93933d81
commit
4be6090107
|
@ -395,7 +395,8 @@ void pipe(Context& context, NormalParams)
|
|||
str += '\n';
|
||||
str = ShellManager::instance().pipe(str, real_cmd, context,
|
||||
{}, 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);
|
||||
strings.push_back(std::move(str));
|
||||
}
|
||||
|
|
1
test/compose/pipe-at-eof/cmd
Normal file
1
test/compose/pipe-at-eof/cmd
Normal file
|
@ -0,0 +1 @@
|
|||
%|sort<ret>
|
3
test/compose/pipe-at-eof/in
Normal file
3
test/compose/pipe-at-eof/in
Normal file
|
@ -0,0 +1,3 @@
|
|||
tchou
|
||||
tchaa
|
||||
tchii
|
3
test/compose/pipe-at-eof/out
Normal file
3
test/compose/pipe-at-eof/out
Normal file
|
@ -0,0 +1,3 @@
|
|||
tchaa
|
||||
tchii
|
||||
tchou
|
Loading…
Reference in New Issue
Block a user