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
87aa0759
Commit
87aa0759
authored
Dec 28, 2008
by
hjk
Committed by
Roberto Raggi
Dec 29, 2008
Browse files
introduce history for ex commands
parent
fd79edf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/handler.cpp
View file @
87aa0759
...
...
@@ -278,7 +278,7 @@ void FakeVimHandler::Private::updateMiniBuffer()
msg
=
QChar
(
m_commandCode
?
m_commandCode
:
' '
);
for
(
int
i
=
0
;
i
!=
m_commandBuffer
.
size
();
++
i
)
{
QChar
c
=
m_commandBuffer
.
at
(
i
);
if
(
c
.
unicode
()
<
64
)
{
if
(
c
.
unicode
()
<
32
)
{
msg
+=
'^'
;
msg
+=
QChar
(
c
.
unicode
()
+
64
);
}
else
{
...
...
@@ -601,27 +601,44 @@ void FakeVimHandler::Private::handleExMode(int key, const QString &text)
m_commandBuffer
.
chop
(
1
);
updateMiniBuffer
();
}
else
if
(
key
==
Key_Return
&&
m_commandCode
==
':'
)
{
handleCommand
(
m_commandBuffer
);
m_commandBuffer
.
clear
();
if
(
!
m_commandBuffer
.
isEmpty
())
{
m_commandHistory
.
takeLast
();
m_commandHistory
.
append
(
m_commandBuffer
);
handleCommand
(
m_commandBuffer
);
m_commandBuffer
.
clear
();
m_commandCode
=
0
;
}
m_mode
=
CommandMode
;
updateMiniBuffer
();
}
else
if
(
key
==
Key_Return
&&
isSearchCommand
())
{
m_lastSearchForward
=
(
m_commandCode
==
'/'
);
m_searchHistory
.
append
(
m_commandBuffer
);
search
(
lastSearchString
(),
m_lastSearchForward
);
m_commandBuffer
.
clear
();
m_commandCode
=
0
;
if
(
!
m_commandBuffer
.
isEmpty
())
{
m_searchHistory
.
takeLast
();
m_searchHistory
.
append
(
m_commandBuffer
);
m_lastSearchForward
=
(
m_commandCode
==
'/'
);
search
(
lastSearchString
(),
m_lastSearchForward
);
m_commandBuffer
.
clear
();
m_commandCode
=
0
;
}
m_mode
=
CommandMode
;
updateMiniBuffer
();
}
else
if
(
key
==
Key_Up
&&
isSearchCommand
()
)
{
if
(
m_searchHistoryIndex
>
0
)
{
}
else
if
(
key
==
Key_Up
)
{
if
(
isSearchCommand
()
&&
m_searchHistoryIndex
>
0
)
{
--
m_searchHistoryIndex
;
m_commandBuffer
=
m_searchHistory
.
at
(
m_searchHistoryIndex
);
}
else
if
(
m_commandCode
==
':'
&&
m_commandHistoryIndex
>
0
)
{
--
m_commandHistoryIndex
;
m_commandBuffer
=
m_commandHistory
.
at
(
m_commandHistoryIndex
);
}
updateMiniBuffer
();
}
else
if
(
key
==
Key_Down
&&
isSearchCommand
())
{
if
(
m_searchHistoryIndex
<
m_searchHistory
.
size
()
-
1
)
{
}
else
if
(
key
==
Key_Down
)
{
if
(
isSearchCommand
()
&&
m_searchHistoryIndex
<
m_searchHistory
.
size
()
-
1
)
{
++
m_searchHistoryIndex
;
m_commandBuffer
=
m_searchHistory
.
at
(
m_searchHistoryIndex
);
}
else
if
(
m_commandCode
==
':'
&&
m_commandHistoryIndex
<
m_commandHistory
.
size
()
-
1
)
{
++
m_commandHistoryIndex
;
m_commandBuffer
=
m_commandHistory
.
at
(
m_commandHistoryIndex
);
}
updateMiniBuffer
();
}
else
if
(
key
==
Key_Tab
)
{
...
...
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