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
Tobias Hunger
qt-creator
Commits
5892ea1b
Commit
5892ea1b
authored
Jun 04, 2009
by
hjk
Browse files
fakevim: fix problem where previously inserted text became part of a '.'
parent
37ea6c42
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
5892ea1b
...
...
@@ -658,7 +658,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
QString
text
=
removeSelectedText
();
//qDebug() << "CHANGING TO INSERT MODE" << text;
m_registers
[
m_register
]
=
text
;
m_mode
=
InsertMode
;
enter
InsertMode
()
;
m_submode
=
NoSubMode
;
}
else
if
(
m_submode
==
DeleteSubMode
)
{
if
(
m_moveType
==
MoveInclusive
)
...
...
@@ -1093,13 +1093,13 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
moveToMatchingParanthesis
();
finishMovement
();
}
else
if
(
key
==
'a'
)
{
m_mode
=
InsertMode
;
enter
InsertMode
()
;
m_lastInsertion
.
clear
();
if
(
!
atEndOfLine
())
moveRight
();
updateMiniBuffer
();
}
else
if
(
key
==
'A'
)
{
m_mode
=
InsertMode
;
enter
InsertMode
()
;
moveToEndOfLine
();
m_lastInsertion
.
clear
();
}
else
if
(
key
==
control
(
'a'
))
{
...
...
@@ -1123,7 +1123,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
setAnchor
();
moveToEndOfLine
();
m_registers
[
m_register
]
=
removeSelectedText
();
m_mode
=
InsertMode
;
enter
InsertMode
()
;
finishMovement
();
}
else
if
(
key
==
control
(
'c'
))
{
showBlackMessage
(
"Type Alt-v,Alt-v to quit FakeVim mode"
);
...
...
@@ -1341,7 +1341,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
// FIXME: right now we repeat the insertion count() times,
// but not the deletion
m_lastInsertion
.
clear
();
m_mode
=
InsertMode
;
enter
InsertMode
()
;
m_submode
=
ReplaceSubMode
;
setDotCommand
(
"R"
);
}
else
if
(
key
==
control
(
'r'
))
{
...
...
tests/auto/fakevim/main.cpp
View file @
5892ea1b
...
...
@@ -68,6 +68,9 @@ private slots:
void
command_up
();
void
command_w
();
// special tests
void
test_i_cw_i
();
private:
void
setup
();
void
send
(
const
QString
&
command
)
{
sendEx
(
"normal "
+
command
);
}
...
...
@@ -114,6 +117,11 @@ const QStringList tst_FakeVim::l = tst_FakeVim::lines.split('\n');
const
QString
tst_FakeVim
::
escape
=
QChar
(
27
);
QString
control
(
int
c
)
{
return
QChar
(
c
+
256
);
}
tst_FakeVim
::
tst_FakeVim
(
bool
usePlainTextEdit
)
{
...
...
@@ -321,6 +329,9 @@ void tst_FakeVim::command_i()
// small insertion at start of document
check
(
"ix"
+
escape
,
"@x"
+
lines
);
check
(
"u"
,
"@"
+
lines
);
// FIXME redo broken
//check(control('r'), "@x" + lines);
//check("u", "@" + lines);
// small insertion at start of document
check
(
"ixxx"
+
escape
,
"xx@x"
+
lines
);
...
...
@@ -341,7 +352,6 @@ void tst_FakeVim::command_i()
// FIXME undo broken
// checkEx("redo", "b@xa" + lines);
// check("u", "@a" + lines);
check
(
"u"
,
"@"
+
lines
);
}
void
tst_FakeVim
::
command_left
()
...
...
@@ -350,8 +360,7 @@ void tst_FakeVim::command_left()
move
(
"4j"
,
"@int main"
);
move
(
"h"
,
"@int main"
);
// no move over left border
move
(
"$"
,
"argv[])@"
);
//move("h", "argv[]@)");
check
(
"h"
,
lmid
(
0
,
4
)
+
"
\n
int main(int argc, char *argv[]@)
\n
"
+
lmid
(
5
));
move
(
"h"
,
"argv[]@)"
);
move
(
"3h"
,
"arg@v[])"
);
move
(
"50h"
,
"@int main"
);
}
...
...
@@ -421,6 +430,16 @@ int main(int argc, char *argv[])
*/
void
tst_FakeVim
::
test_i_cw_i
()
{
setup
();
move
(
"j"
,
"@"
+
l
[
1
]);
check
(
"ixx"
+
escape
,
l
[
0
]
+
"
\n
x@x"
+
lmid
(
1
));
return
;
// FIXME: not in sync with Gui behaviour?
check
(
"cwyy"
+
escape
,
l
[
0
]
+
"
\n
xy@y"
+
lmid
(
1
));
check
(
"iaa"
+
escape
,
l
[
0
]
+
"
\n
xya@ay"
+
lmid
(
1
));
}
//////////////////////////////////////////////////////////////////////////
//
...
...
tests/manual/gdbdebugger/simple/app/app.pro
View file @
5892ea1b
...
...
@@ -6,7 +6,8 @@ DESTDIR = ..
#
Input
SOURCES
+=
..
/
app
.
cpp
#
SOURCES
+=
..
/../../../../
share
/
qtcreator
/
gdbmacros
/
gdbmacros
.
cpp
QT
+=
network
#
SOURCES
+=
..
/../../../../
share
/
qtcreator
/
gdbmacros
/
gdbmacros
.
cpp
QT
+=
network
message
(
"this says <foo & bar>"
)
FORMS
+=
..
/
form
.
ui
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