From d277ef6d6c38ed35b46b20215aaf1c7b2621f1e7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 17 Mar 2016 12:08:11 +0000 Subject: [PATCH] Slight code tweaks in normal mode pipe function --- src/normal.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/normal.cc b/src/normal.cc index c967559ef..5f5fb1779 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -398,16 +398,15 @@ void pipe(Context& context, NormalParams) Vector strings; for (auto& sel : selections) { - auto in = content(buffer, sel); - bool insert_eol = in.back() != '\n'; + String in = content(buffer, sel); + const bool insert_eol = in.back() != '\n'; if (insert_eol) in += '\n'; - auto out = ShellManager::instance().eval( + String out = ShellManager::instance().eval( real_cmd, context, in, ShellManager::Flags::WaitForStdout).first; - if ((insert_eol or sel.max() == buffer.back_coord()) and - out.back() == '\n') + if (insert_eol and out.back() == '\n') out = out.substr(0, out.length()-1).str(); strings.push_back(std::move(out)); }