forked from qt-creator/qt-creator
fakevim: implement 's' in visual block mode
Cursor positioning after the operation is wrong, but bearable.
This commit is contained in:
@@ -2407,6 +2407,18 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
|
||||
updateMiniBuffer();
|
||||
} else if (input.isControl('r')) {
|
||||
redo();
|
||||
} else if (input.is('s') && isVisualBlockMode()) {
|
||||
Range range(position(), anchor(), RangeBlockMode);
|
||||
int beginLine = lineForPosition(anchor());
|
||||
int endLine = lineForPosition(position());
|
||||
m_visualInsertCount = qAbs(endLine - beginLine);
|
||||
setPosition(qMin(position(), anchor()));
|
||||
yankText(range, m_register);
|
||||
removeText(range);
|
||||
setDotCommand("%1s", count());
|
||||
setUndoPosition(position());
|
||||
breakEditBlock();
|
||||
enterInsertMode();
|
||||
} else if (input.is('s')) {
|
||||
leaveVisualMode();
|
||||
if (atEndOfLine())
|
||||
|
||||
Reference in New Issue
Block a user