Skip to content
GitLab
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
f449bc6f
Commit
f449bc6f
authored
Jan 27, 2009
by
hjk
Browse files
Fixes: fakevim: fix cursor positioning after search
parent
21f15207
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
f449bc6f
...
...
@@ -1582,10 +1582,14 @@ void FakeVimHandler::Private::search(const QString &needle0, bool forward)
if
(
forward
)
m_tc
.
movePosition
(
Right
,
MoveAnchor
,
1
);
int
oldLine
=
cursorLineInDocument
()
-
cursorLineOnScreen
();
EDITOR
(
setTextCursor
(
m_tc
));
if
(
EDITOR
(
find
(
needle
,
flags
)))
{
m_tc
=
EDITOR
(
textCursor
());
m_tc
.
setPosition
(
m_tc
.
anchor
());
if
(
oldLine
!=
cursorLineInDocument
()
-
cursorLineOnScreen
())
scrollToLineInDocument
(
cursorLineInDocument
()
-
linesOnScreen
()
/
2
);
return
;
}
...
...
@@ -1594,6 +1598,8 @@ void FakeVimHandler::Private::search(const QString &needle0, bool forward)
if
(
EDITOR
(
find
(
needle
,
flags
)))
{
m_tc
=
EDITOR
(
textCursor
());
m_tc
.
setPosition
(
m_tc
.
anchor
());
if
(
oldLine
!=
cursorLineInDocument
()
-
cursorLineOnScreen
())
scrollToLineInDocument
(
cursorLineInDocument
()
-
linesOnScreen
()
/
2
);
if
(
forward
)
showRedMessage
(
"search hit BOTTOM, continuing at TOP"
);
else
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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