summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-03-06 13:57:21 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-03-06 13:57:21 +0000
commit4be609010758f0daef1be567a2b2bbea20700e1e (patch)
tree3b9443b26ce17bbfcf56eac51b995ed887f6e1aa /src/normal.cc
parent2d93933d81ea7e00b0541396e11087ef01c4ff7d (diff)
Fix additional eol inserted when replace piping at end of buffer
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 02f5490c..2cf066d0 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -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));
}