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
21f15207
Commit
21f15207
authored
Jan 27, 2009
by
hjk
Browse files
Fixes: fakevim: more 'z' commands
parent
ccfbdf5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
21f15207
...
...
@@ -688,17 +688,27 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
indentRegion
(
m_tc
.
block
(),
m_tc
.
block
().
next
());
finishMovement
();
}
else
if
(
m_submode
==
ZSubMode
)
{
if
(
key
==
Key_Return
)
{
// cursor line to top of window, cursor on first non-blank
//qDebug() << "Z_MODE " << cursorLineInDocument() << linesOnScreen();
if
(
key
==
Key_Return
||
key
==
't'
)
{
// cursor line to top of window
if
(
!
m_mvcount
.
isEmpty
())
m_tc
.
setPosition
(
positionForLine
(
count
()));
scrollToLineInDocument
(
cursorLineInDocument
());
moveToFirstNonBlankOnLine
();
if
(
key
==
Key_Return
)
moveToFirstNonBlankOnLine
();
finishMovement
();
}
else
if
(
key
==
'.'
)
{
// center cursor line
}
else
if
(
key
==
'.'
||
key
==
'z'
)
{
// cursor line to center of window
if
(
!
m_mvcount
.
isEmpty
())
m_tc
.
setPosition
(
positionForLine
(
count
()));
scrollToLineInDocument
(
cursorLineInDocument
()
-
linesOnScreen
()
/
2
);
moveToFirstNonBlankOnLine
();
if
(
key
==
'.'
)
moveToFirstNonBlankOnLine
();
finishMovement
();
}
else
if
(
key
==
'z'
)
{
// center cursor line
scrollToLineInDocument
(
cursorLineInDocument
()
-
linesOnScreen
()
/
2
);
}
else
if
(
key
==
'-'
||
key
==
'b'
)
{
// cursor line to bottom of window
if
(
!
m_mvcount
.
isEmpty
())
m_tc
.
setPosition
(
positionForLine
(
count
()));
scrollToLineInDocument
(
cursorLineInDocument
()
-
linesOnScreen
()
-
1
);
if
(
key
==
'-'
)
moveToFirstNonBlankOnLine
();
finishMovement
();
}
else
{
qDebug
()
<<
"IGNORED Z_MODE "
<<
key
<<
text
;
...
...
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