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
95fbb484
Commit
95fbb484
authored
Jan 08, 2009
by
hjk
Browse files
handle 'P'
parent
cab13a5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/handler.cpp
View file @
95fbb484
...
...
@@ -299,7 +299,7 @@ bool FakeVimHandler::Private::eventFilter(QObject *ob, QEvent *ev)
key
+=
32
;
if
((
keyEvent
->
modifiers
()
&
Qt
::
ControlModifier
)
!=
0
)
key
+=
256
;
handleKey
(
key
,
keyEvent
->
text
());
bool
handled
=
handleKey
(
key
,
keyEvent
->
text
());
// We fake vi-style end-of-line behaviour
m_fakeEnd
=
(
atEol
()
&&
m_mode
==
CommandMode
);
...
...
@@ -309,7 +309,7 @@ bool FakeVimHandler::Private::eventFilter(QObject *ob, QEvent *ev)
EDITOR
(
setTextCursor
(
m_tc
));
EDITOR
(
ensureCursorVisible
());
return
true
;
return
handled
;
}
bool
FakeVimHandler
::
Private
::
handleKey
(
int
key
,
const
QString
&
text
)
...
...
@@ -669,16 +669,18 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
m_tc
.
movePosition
(
StartOfLine
,
MoveAnchor
);
m_tc
.
movePosition
(
Left
,
MoveAnchor
,
1
);
m_tc
.
insertText
(
"
\n
"
);
}
else
if
(
key
==
'p'
)
{
}
else
if
(
key
==
'p'
||
key
==
'P'
)
{
QString
text
=
m_registers
[
m_register
];
int
n
=
text
.
count
(
QChar
(
ParagraphSeparator
));
if
(
n
>
0
)
{
m_tc
.
movePosition
(
StartOfLine
);
m_tc
.
movePosition
(
Down
);
if
(
key
==
'p'
)
m_tc
.
movePosition
(
Down
);
m_tc
.
insertText
(
text
);
m_tc
.
movePosition
(
Up
,
MoveAnchor
,
n
);
}
else
{
m_tc
.
movePosition
(
Right
);
if
(
key
==
'p'
)
m_tc
.
movePosition
(
Right
);
m_tc
.
insertText
(
text
);
m_tc
.
movePosition
(
Left
);
}
...
...
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