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
4f1dd949
Commit
4f1dd949
authored
Jan 23, 2009
by
hjk
Browse files
Fixes: fakevim: work on 'e', 'w', 'b'...
parent
153fd8a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
4f1dd949
...
...
@@ -480,8 +480,8 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
m_mode
=
InsertMode
;
m_submode
=
NoSubMode
;
}
else
if
(
m_submode
==
DeleteSubMode
)
{
//
if (m_moveType == Move
Ex
clusive)
//
move
Lef
t(); // correct
if
(
m_moveType
==
Move
In
clusive
)
move
Righ
t
();
// correct
if
(
!
dotCommand
.
isEmpty
())
m_dotCommand
=
"d"
+
dotCommand
;
m_registers
[
m_register
]
=
recordRemoveSelectedText
();
...
...
@@ -807,9 +807,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
recordBeginGroup
();
m_lastInsertion
.
clear
();
}
else
if
(
key
==
'b'
)
{
m_moveType
=
MoveExclusive
;
moveToWordBoundary
(
false
,
false
);
finishMovement
();
}
else
if
(
key
==
'B'
)
{
m_moveType
=
MoveExclusive
;
moveToWordBoundary
(
true
,
false
);
finishMovement
();
}
else
if
(
key
==
'c'
)
{
...
...
@@ -846,10 +848,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
moveRight
(
rightDist
());
finishMovement
();
}
else
if
(
key
==
'e'
)
{
m_moveType
=
MoveInclusive
;
moveToWordBoundary
(
false
,
true
);
m_moveType
=
MoveExclusive
;
finishMovement
();
}
else
if
(
key
==
'E'
)
{
m_moveType
=
MoveInclusive
;
moveToWordBoundary
(
true
,
true
);
finishMovement
();
}
else
if
(
key
==
'f'
||
key
==
'F'
)
{
...
...
@@ -1614,8 +1617,7 @@ void FakeVimHandler::Private::moveToWordBoundary(bool simple, bool forward)
int
n
=
forward
?
lastPositionInDocument
()
-
1
:
0
;
int
lastClass
=
-
1
;
while
(
true
)
{
forward
?
moveRight
()
:
moveLeft
();
QChar
c
=
doc
->
characterAt
(
m_tc
.
position
());
QChar
c
=
doc
->
characterAt
(
m_tc
.
position
()
+
(
forward
?
1
:
-
1
));
int
thisClass
=
charClass
(
c
,
simple
);
if
(
thisClass
!=
lastClass
&&
lastClass
!=
0
)
--
repeat
;
...
...
@@ -1624,6 +1626,7 @@ void FakeVimHandler::Private::moveToWordBoundary(bool simple, bool forward)
lastClass
=
thisClass
;
if
(
m_tc
.
position
()
==
n
)
break
;
forward
?
moveRight
()
:
moveLeft
();
}
}
...
...
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