Skip to content
GitLab
Menu
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
9a224d7e
Commit
9a224d7e
authored
Jan 22, 2009
by
hjk
Browse files
Fixes: fakevim: 'r' and 'R' revisited
parent
cabc2da9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
9a224d7e
...
...
@@ -105,7 +105,7 @@ enum SubMode
ChangeSubMode
,
DeleteSubMode
,
FilterSubMode
,
ReplaceSubMode
,
// used for R
ReplaceSubMode
,
// used for R
and r
YankSubMode
,
IndentSubMode
,
ZSubMode
,
...
...
@@ -113,12 +113,13 @@ enum SubMode
enum
SubSubMode
{
// typically used for things that require one more data item
// and are 'nested' behind a mode
NoSubSubMode
,
FtSubSubMode
,
// used for f, F, t, T
MarkSubSubMode
,
// used for m
BackTickSubSubMode
,
// used for `
TickSubSubMode
,
// used for '
ReplaceSubSubMode
// used for r
};
enum
VisualMode
...
...
@@ -633,12 +634,6 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
moveDown
(
count
());
m_moveType
=
MoveLineWise
;
finishMovement
(
"y"
);
}
else
if
(
m_submode
==
ReplaceSubMode
)
{
if
(
atEol
())
moveLeft
();
else
m_tc
.
deleteChar
();
recordInsertText
(
text
);
}
else
if
(
m_submode
==
IndentSubMode
&&
key
==
'='
)
{
indentRegion
(
m_tc
.
block
(),
m_tc
.
block
().
next
());
finishMovement
();
...
...
@@ -656,7 +651,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
handleFfTt
(
key
);
m_subsubmode
=
NoSubSubMode
;
finishMovement
(
QString
(
QChar
(
m_subsubdata
))
+
QChar
(
key
));
}
else
if
(
m_
sub
submode
==
ReplaceSub
Sub
Mode
)
{
}
else
if
(
m_submode
==
ReplaceSubMode
)
{
if
(
count
()
<
rightDist
()
&&
text
.
size
()
==
1
&&
(
text
.
at
(
0
).
isPrint
()
||
text
.
at
(
0
).
isSpace
()))
{
recordBeginGroup
();
...
...
@@ -666,11 +661,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
recordInsertText
(
QString
(
count
(),
text
.
at
(
0
)));
recordEndGroup
();
m_moveType
=
MoveExclusive
;
m_
sub
submode
=
NoSub
Sub
Mode
;
m_submode
=
NoSubMode
;
m_dotCommand
=
QString
(
"%1r%2"
).
arg
(
count
()).
arg
(
text
);
finishMovement
();
}
else
{
m_
sub
submode
=
NoSub
Sub
Mode
;
m_submode
=
NoSubMode
;
}
}
else
if
(
m_subsubmode
==
MarkSubSubMode
)
{
m_marks
[
key
]
=
m_tc
.
position
();
...
...
@@ -947,10 +942,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
recordEndGroup
();
m_dotCommand
=
"p"
;
}
else
if
(
key
==
'r'
)
{
m_
sub
submode
=
ReplaceSub
Sub
Mode
;
m_submode
=
ReplaceSubMode
;
m_dotCommand
=
"r"
;
}
else
if
(
key
==
'R'
)
{
// FIXME: right now we repeat the insertion count() times,
// but not the deletion
recordBeginGroup
();
m_lastInsertion
.
clear
();
m_mode
=
InsertMode
;
m_submode
=
ReplaceSubMode
;
m_dotCommand
=
"R"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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