forked from qt-creator/qt-creator
fakevim: fix insert of tabs when shifting to the right
(cherry picked from commit 3eb7b6bfbde6a847154c6053e7b4171554207865)
This commit is contained in:
@@ -3611,13 +3611,13 @@ void FakeVimHandler::Private::shiftRegionRight(int repeat)
|
|||||||
if (hasConfig(ConfigStartOfLine))
|
if (hasConfig(ConfigStartOfLine))
|
||||||
targetPos = firstPositionInLine(beginLine);
|
targetPos = firstPositionInLine(beginLine);
|
||||||
|
|
||||||
int len = config(ConfigShiftWidth).toInt() * repeat;
|
const int sw = config(ConfigShiftWidth).toInt();
|
||||||
QString indent(len, ' ');
|
|
||||||
|
|
||||||
beginEditBlock(targetPos);
|
beginEditBlock(targetPos);
|
||||||
for (int line = beginLine; line <= endLine; ++line) {
|
for (int line = beginLine; line <= endLine; ++line) {
|
||||||
setPosition(firstPositionInLine(line));
|
QString data = lineContents(line);
|
||||||
m_tc.insertText(indent);
|
const Column col = indentation(data);
|
||||||
|
data = tabExpand(col.logical + sw * repeat) + data.mid(col.physical);
|
||||||
|
setLineContents(line, data);
|
||||||
}
|
}
|
||||||
endEditBlock();
|
endEditBlock();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user