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