-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
Qt Creator 2.3.0-beta
-
None
-
30076b1c97b8246a106f98b2a57a2f3fc3326110
When text is pasted in vim while a selection is active (in visual mode), the visually highlighted text should be removed, and replaced with the clipboard text.
Currently in Fakevim, the text is left behind (truly annoying!!).
In the void FakeVimHandler::Private::pasteText(bool afterCursor) function, after the line:
const QStringList lines = text.split(QChar('\n'));
I added the following lines, which fixed the problem:
if (isVisualCharMode())
{ leaveVisualMode(); m_submode = DeleteSubMode; finishMovement(); afterCursor = false; }else if (isVisualLineMode())
{ leaveVisualMode(); m_rangemode = RangeLineMode; yankText(currentRange(), m_register); removeText(currentRange()); handleStartOfLine(); afterCursor = false; }else if (isVisualBlockMode())
{ leaveVisualMode(); m_rangemode = RangeBlockMode; yankText(currentRange(), m_register); removeText(currentRange()); setPosition(qMin(position(), anchor())); afterCursor = false; }This results in a substantial improvement to the usability of Fakevim.
For Gerrit Dashboard: QTCREATORBUG-5605 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
2669,1 | fakevim: remove visually selected contents before pasting. | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |