From 0fe9683c0fd880c3def505a5465239cab54559c8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 29 Mar 2014 09:02:09 +0000 Subject: [PATCH] Fix indent/deindent when only empty lines are selected --- src/normal.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/normal.cc b/src/normal.cc index 75b04e59..73346a75 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -787,8 +787,11 @@ void indent(Context& context, int) sels.emplace_back(line, line); } } - ScopedEdition edition(context); - insert(buffer, sels, indent); + if (not sels.empty()) + { + ScopedEdition edition(context); + insert(buffer, sels, indent); + } } template @@ -828,8 +831,11 @@ void deindent(Context& context, int) } } } - ScopedEdition edition(context); - erase(context.buffer(), sels); + if (not sels.empty()) + { + ScopedEdition edition(context); + erase(context.buffer(), sels); + } } template