From 4010117c983712926b028b4d6f37e6a0600b0105 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 8 May 2014 19:30:10 +0100 Subject: [PATCH] fix tabs_to_space on consecutive tabs --- src/normal.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/normal.cc b/src/normal.cc index 548e3db4..c856ebe7 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1163,7 +1163,7 @@ void tabs_to_spaces(Context& context, int ts) for (auto& sel : context.selections()) { for (auto it = buffer.iterator_at(sel.min()), - end = buffer.iterator_at(sel.max())+1; it != end; ++it) + end = buffer.iterator_at(sel.max())+1; it != end;) { if (*it == '\t') { @@ -1173,6 +1173,8 @@ void tabs_to_spaces(Context& context, int ts) it = buffer.insert(it, String{ ' ', end_col - col }) + (int)(end_col - col); end = buffer.iterator_at(sel.max())+1; } + else + ++it; } } }