Commit 5f67f7c4 authored by hjk's avatar hjk
Browse files

fakevim: fix insert of tabs when shifting to the right

(cherry picked from commit 3eb7b6bfbde6a847154c6053e7b4171554207865)
parent 15047f88
......@@ -3611,13 +3611,13 @@ void FakeVimHandler::Private::shiftRegionRight(int repeat)
if (hasConfig(ConfigStartOfLine))
targetPos = firstPositionInLine(beginLine);
int len = config(ConfigShiftWidth).toInt() * repeat;
QString indent(len, ' ');
const int sw = config(ConfigShiftWidth).toInt();
beginEditBlock(targetPos);
for (int line = beginLine; line <= endLine; ++line) {
setPosition(firstPositionInLine(line));
m_tc.insertText(indent);
QString data = lineContents(line);
const Column col = indentation(data);
data = tabExpand(col.logical + sw * repeat) + data.mid(col.physical);
setLineContents(line, data);
}
endEditBlock();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment