Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
b919dbe5
Commit
b919dbe5
authored
Jun 11, 2009
by
hjk
Browse files
Options
Downloads
Patches
Plain Diff
fakevim: fix cursor column positioning bug after cfx + <Down>
parent
dc472570
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/fakevim/fakevimhandler.cpp
+11
-3
11 additions, 3 deletions
src/plugins/fakevim/fakevimhandler.cpp
tests/auto/fakevim/main.cpp
+13
-0
13 additions, 0 deletions
tests/auto/fakevim/main.cpp
with
24 additions
and
3 deletions
src/plugins/fakevim/fakevimhandler.cpp
+
11
−
3
View file @
b919dbe5
...
@@ -253,7 +253,10 @@ public:
...
@@ -253,7 +253,10 @@ public:
void
moveToFirstNonBlankOnLine
();
void
moveToFirstNonBlankOnLine
();
void
moveToTargetColumn
();
void
moveToTargetColumn
();
void
setTargetColumn
()
{
m_targetColumn
=
leftDist
();
}
void
setTargetColumn
()
{
m_targetColumn
=
leftDist
();
//qDebug() << "TARGET: " << m_targetColumn;
}
void
moveToNextWord
(
bool
simple
);
void
moveToNextWord
(
bool
simple
);
void
moveToMatchingParanthesis
();
void
moveToMatchingParanthesis
();
void
moveToWordBoundary
(
bool
simple
,
bool
forward
);
void
moveToWordBoundary
(
bool
simple
,
bool
forward
);
...
@@ -672,6 +675,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
...
@@ -672,6 +675,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
m_submode
=
NoSubMode
;
m_submode
=
NoSubMode
;
if
(
atEndOfLine
())
if
(
atEndOfLine
())
moveLeft
();
moveLeft
();
else
setTargetColumn
();
}
else
if
(
m_submode
==
YankSubMode
)
{
}
else
if
(
m_submode
==
YankSubMode
)
{
m_registers
[
m_register
]
=
selectedText
();
m_registers
[
m_register
]
=
selectedText
();
setPosition
(
m_savedYankPosition
);
setPosition
(
m_savedYankPosition
);
...
@@ -2507,9 +2512,12 @@ void FakeVimHandler::Private::replay(const QString &command, int n)
...
@@ -2507,9 +2512,12 @@ void FakeVimHandler::Private::replay(const QString &command, int n)
{
{
//qDebug() << "REPLAY: " << command;
//qDebug() << "REPLAY: " << command;
m_inReplay
=
true
;
m_inReplay
=
true
;
for
(
int
i
=
n
;
--
i
>=
0
;
)
for
(
int
i
=
n
;
--
i
>=
0
;
)
{
foreach
(
QChar
c
,
command
)
foreach
(
QChar
c
,
command
)
{
//qDebug() << " REPLAY: " << QString(c);
handleKey
(
c
.
unicode
(),
c
.
unicode
(),
QString
(
c
));
handleKey
(
c
.
unicode
(),
c
.
unicode
(),
QString
(
c
));
}
}
m_inReplay
=
false
;
m_inReplay
=
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/auto/fakevim/main.cpp
+
13
−
0
View file @
b919dbe5
...
@@ -60,6 +60,7 @@ private slots:
...
@@ -60,6 +60,7 @@ private slots:
void
command_dd
();
void
command_dd
();
void
command_dollar
();
void
command_dollar
();
void
command_down
();
void
command_down
();
void
command_dfx_down
();
void
command_e
();
void
command_e
();
void
command_i
();
void
command_i
();
void
command_left
();
void
command_left
();
...
@@ -296,6 +297,18 @@ void tst_FakeVim::command_down()
...
@@ -296,6 +297,18 @@ void tst_FakeVim::command_down()
move
(
"4j"
,
"@ return app.exec()"
);
move
(
"4j"
,
"@ return app.exec()"
);
}
}
void
tst_FakeVim
::
command_dfx_down
()
{
setup
();
check
(
"j4l"
,
l
[
0
]
+
"
\n
#inc@lude <QtCore>
\n
"
+
lmid
(
2
));
check
(
"df "
,
l
[
0
]
+
"
\n
#inc@<QtCore>
\n
"
+
lmid
(
2
));
check
(
"j"
,
l
[
0
]
+
"
\n
#inc<QtCore>
\n
#inc@lude <QtGui>
\n
"
+
lmid
(
3
));
check
(
"."
,
l
[
0
]
+
"
\n
#inc<QtCore>
\n
#inc@<QtGui>
\n
"
+
lmid
(
3
));
return
;
check
(
"u"
,
l
[
0
]
+
"
\n
#inc<QtCore>
\n
#inc@lude <QtGui>
\n
"
+
lmid
(
3
));
check
(
"u"
,
l
[
0
]
+
"
\n
#inc@lude <QtCore>
\n
"
+
lmid
(
2
));
}
void
tst_FakeVim
::
command_e
()
void
tst_FakeVim
::
command_e
()
{
{
setup
();
setup
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment