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
4350baee
Commit
4350baee
authored
May 29, 2009
by
Rhys Weatherley
Browse files
Map n and N in FakeVim to the FIND_NEXT and FIND_PREVIOUS actions.
parent
6d4d0f04
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
4350baee
...
...
@@ -944,9 +944,9 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
// Recognize ZZ and ZQ as aliases for ":x" and ":q!".
m_submode
=
NoSubMode
;
if
(
key
==
'Z'
)
handle
Ex
Command
(
"x"
);
handleCommand
(
"x"
);
else
if
(
key
==
'Q'
)
handle
Ex
Command
(
"q!"
);
handleCommand
(
"q!"
);
}
else
if
(
m_subsubmode
==
FtSubSubMode
)
{
m_semicolonType
=
m_subsubdata
;
m_semicolonKey
=
key
;
...
...
@@ -1291,10 +1291,10 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
handleStartOfLine
();
finishMovement
();
}
else
if
(
key
==
'n'
)
{
search
(
lastSearchString
(),
m_lastSearchForward
);
emit
q
->
findNextRequested
(
false
);
recordJump
();
}
else
if
(
key
==
'N'
)
{
search
(
lastSearchString
(),
!
m_lastSearchForward
);
emit
q
->
findNextRequested
(
true
);
recordJump
();
}
else
if
(
key
==
'o'
||
key
==
'O'
)
{
setDotCommand
(
"%1o"
,
count
());
...
...
src/plugins/fakevim/fakevimhandler.h
View file @
4350baee
...
...
@@ -75,6 +75,7 @@ signals:
void
completionRequested
();
void
windowCommandRequested
(
int
key
);
void
findRequested
(
bool
reverse
);
void
findNextRequested
(
bool
reverse
);
public:
class
Private
;
...
...
src/plugins/fakevim/fakevimplugin.cpp
View file @
4350baee
...
...
@@ -235,6 +235,7 @@ private slots:
void
triggerCompletions
();
void
windowCommand
(
int
key
);
void
find
(
bool
reverse
);
void
findNext
(
bool
reverse
);
void
showSettingsDialog
();
void
showCommandBuffer
(
const
QString
&
contents
);
...
...
@@ -367,6 +368,14 @@ void FakeVimPluginPrivate::find(bool reverse)
triggerAction
(
Find
::
Constants
::
FIND_IN_DOCUMENT
);
}
void
FakeVimPluginPrivate
::
findNext
(
bool
reverse
)
{
if
(
reverse
)
triggerAction
(
Find
::
Constants
::
FIND_PREVIOUS
);
else
triggerAction
(
Find
::
Constants
::
FIND_NEXT
);
}
void
FakeVimPluginPrivate
::
editorOpened
(
Core
::
IEditor
*
editor
)
{
if
(
!
editor
)
...
...
@@ -408,6 +417,8 @@ void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor)
this
,
SLOT
(
windowCommand
(
int
)));
connect
(
handler
,
SIGNAL
(
findRequested
(
bool
)),
this
,
SLOT
(
find
(
bool
)));
connect
(
handler
,
SIGNAL
(
findNextRequested
(
bool
)),
this
,
SLOT
(
findNext
(
bool
)));
handler
->
setCurrentFileName
(
editor
->
file
()
->
fileName
());
handler
->
installEventFilter
();
...
...
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