forked from qt-creator/qt-creator
fakevim: fix 'dG'
This commit is contained in:
@@ -690,7 +690,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
|
|||||||
m_gflag = true;
|
m_gflag = true;
|
||||||
} else if (key == 'G') {
|
} else if (key == 'G') {
|
||||||
int n = m_mvcount.isEmpty() ? linesInDocument() : count();
|
int n = m_mvcount.isEmpty() ? linesInDocument() : count();
|
||||||
m_tc.setPosition(positionForLine(n), MoveAnchor);
|
m_tc.setPosition(positionForLine(n), KeepAnchor);
|
||||||
if (m_config.contains(ConfigStartOfLine))
|
if (m_config.contains(ConfigStartOfLine))
|
||||||
moveToFirstNonBlankOnLine();
|
moveToFirstNonBlankOnLine();
|
||||||
finishMovement();
|
finishMovement();
|
||||||
@@ -1245,7 +1245,7 @@ void FakeVimHandler::Private::moveToFirstNonBlankOnLine()
|
|||||||
{
|
{
|
||||||
QTextBlock block = m_tc.block();
|
QTextBlock block = m_tc.block();
|
||||||
QTextDocument *doc = m_tc.document();
|
QTextDocument *doc = m_tc.document();
|
||||||
m_tc.movePosition(StartOfLine);
|
m_tc.movePosition(StartOfLine, KeepAnchor);
|
||||||
int firstPos = m_tc.position();
|
int firstPos = m_tc.position();
|
||||||
for (int i = firstPos, n = firstPos + block.length(); i < n; ++i) {
|
for (int i = firstPos, n = firstPos + block.length(); i < n; ++i) {
|
||||||
if (!doc->characterAt(i).isSpace()) {
|
if (!doc->characterAt(i).isSpace()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user