Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
06140f9c
Commit
06140f9c
authored
Aug 18, 2009
by
hjk
Browse files
fakevim: fix 'ddp'
Was broken recently during the yank/paste rework.
parent
ec2b2330
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
06140f9c
...
...
@@ -954,12 +954,15 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
setDotCommand
(
"%1cc"
,
count
());
finishMovement
();
}
else
if
(
m_submode
==
DeleteSubMode
&&
key
==
'd'
)
{
// tested
moveToStartOfLine
();
setTargetColumn
();
setAnchor
();
moveDown
(
count
());
m_movetype
=
MoveLineWise
;
int
endPos
=
firstPositionInLine
(
lineForPosition
(
position
())
+
count
()
-
1
);
Range
range
(
position
(),
endPos
,
RangeLineMode
);
yankText
(
range
);
removeText
(
range
);
setDotCommand
(
"%1dd"
,
count
());
m_submode
=
NoSubMode
;
moveToFirstNonBlankOnLine
();
setTargetColumn
();
finishMovement
();
}
else
if
(
m_submode
==
YankSubMode
&&
key
==
'y'
)
{
m_movetype
=
MoveLineWise
;
...
...
tests/auto/fakevim/main.cpp
View file @
06140f9c
...
...
@@ -58,6 +58,7 @@ private slots:
// command mode
void
command_cc
();
void
command_dd
();
void
command_dd_2
();
void
command_dollar
();
void
command_down
();
void
command_dfx_down
();
...
...
@@ -277,13 +278,23 @@ void tst_FakeVim::command_dd()
move
(
"j"
,
"@"
+
l
[
1
]);
check
(
"dd"
,
l
[
0
]
+
"
\n
@"
+
lmid
(
2
));
check
(
"."
,
l
[
0
]
+
"
\n
@"
+
lmid
(
3
));
check
(
"3dd"
,
l
[
0
]
+
"
\n
@
"
+
lmid
(
6
));
check
(
"
8
l"
,
l
[
0
]
+
"
\n
QApp@lication app(argc, argv);
\n
"
+
lmid
(
7
));
check
(
"3dd"
,
l
[
0
]
+
"
\n
@QApplication app(argc, argv);
\n
"
+
lmid
(
7
));
check
(
"
4
l"
,
l
[
0
]
+
"
\n
QApp@lication app(argc, argv);
\n
"
+
lmid
(
7
));
check
(
"dd"
,
l
[
0
]
+
"
\n
@"
+
lmid
(
7
));
check
(
"."
,
l
[
0
]
+
"
\n
@
"
+
lmid
(
8
));
check
(
"."
,
l
[
0
]
+
"
\n
@return app.exec();
\n
"
+
lmid
(
9
));
check
(
"dd"
,
l
[
0
]
+
"
\n
@"
+
lmid
(
9
));
}
void
tst_FakeVim
::
command_dd_2
()
{
setup
();
move
(
"j"
,
"@"
+
l
[
1
]);
check
(
"dd"
,
l
[
0
]
+
"
\n
@"
+
lmid
(
2
));
check
(
"p"
,
l
[
0
]
+
"
\n
"
+
l
[
2
]
+
"
\n
@"
+
l
[
1
]
+
"
\n
"
+
lmid
(
3
));
return
;
// FIXME
check
(
"u"
,
l
[
0
]
+
"
\n
@"
+
lmid
(
2
));
}
void
tst_FakeVim
::
command_dollar
()
{
setup
();
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment