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
4c80a1ab
Commit
4c80a1ab
authored
Feb 19, 2010
by
Martin Aumüller
Committed by
hjk
Feb 19, 2010
Browse files
fakevim: dfx should do nothing if no x is found
Merge-request: 113 Reviewed-by:
hjk
<
qtc-committer@nokia.com
>
parent
6648fe43
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
4c80a1ab
...
...
@@ -378,7 +378,7 @@ public:
void
setAnchor
(
int
position
)
{
if
(
!
isVisualMode
())
m_anchor
=
position
;
}
void
setPosition
(
int
position
)
{
m_tc
.
setPosition
(
position
,
MoveAnchor
);
}
void
handleFfTt
(
int
key
);
bool
handleFfTt
(
int
key
);
// helper function for handleExCommand. return 1 based line index.
int
readLineCode
(
QString
&
cmd
);
...
...
@@ -1222,12 +1222,17 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
}
else
if
(
m_subsubmode
==
FtSubSubMode
)
{
m_semicolonType
=
m_subsubdata
;
m_semicolonKey
=
key
;
handleFfTt
(
key
);
bool
valid
=
handleFfTt
(
key
);
m_subsubmode
=
NoSubSubMode
;
finishMovement
(
QString
(
"%1%2%3"
)
.
arg
(
count
())
.
arg
(
QChar
(
m_semicolonType
))
.
arg
(
QChar
(
m_semicolonKey
)));
if
(
!
valid
)
{
m_submode
=
NoSubMode
;
finishMovement
();
}
else
{
finishMovement
(
QString
(
"%1%2%3"
)
.
arg
(
count
())
.
arg
(
QChar
(
m_semicolonType
))
.
arg
(
QChar
(
m_semicolonKey
)));
}
}
else
if
(
m_submode
==
ReplaceSubMode
)
{
if
(
count
()
<=
(
rightDist
()
+
atEndOfLine
())
&&
text
.
size
()
==
1
&&
(
text
.
at
(
0
).
isPrint
()
||
text
.
at
(
0
).
isSpace
()))
{
...
...
@@ -2806,8 +2811,9 @@ void FakeVimHandler::Private::moveToWordBoundary(bool simple, bool forward, bool
setTargetColumn
();
}
void
FakeVimHandler
::
Private
::
handleFfTt
(
int
key
)
bool
FakeVimHandler
::
Private
::
handleFfTt
(
int
key
)
{
int
oldPos
=
position
();
// m_subsubmode \in { 'f', 'F', 't', 'T' }
bool
forward
=
m_subsubdata
==
'f'
||
m_subsubdata
==
't'
;
int
repeat
=
count
();
...
...
@@ -2839,7 +2845,13 @@ void FakeVimHandler::Private::handleFfTt(int key)
break
;
}
}
setTargetColumn
();
if
(
repeat
==
0
)
{
setTargetColumn
();
return
true
;
}
else
{
setPosition
(
oldPos
);
return
false
;
}
}
void
FakeVimHandler
::
Private
::
moveToNextWord
(
bool
simple
,
bool
deleteWord
)
...
...
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