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
0b3b3988
Commit
0b3b3988
authored
May 10, 2010
by
hjk
Browse files
fakevim: try to "export" also block selections.
parent
c22678ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
0b3b3988
...
@@ -1011,11 +1011,13 @@ void FakeVimHandler::Private::importSelection()
...
@@ -1011,11 +1011,13 @@ void FakeVimHandler::Private::importSelection()
QTextCursor
tc
=
EDITOR
(
textCursor
());
QTextCursor
tc
=
EDITOR
(
textCursor
());
int
pos
=
tc
.
position
();
int
pos
=
tc
.
position
();
int
anc
=
tc
.
anchor
();
int
anc
=
tc
.
anchor
();
// FIXME: Why?
if
(
tc
.
hasSelection
())
{
if
(
pos
<
anc
)
// FIXME: Why?
--
anc
;
if
(
pos
<
anc
)
else
--
anc
;
tc
.
movePosition
(
Left
,
KeepAnchor
);
else
tc
.
movePosition
(
Left
,
KeepAnchor
);
}
m_marks
[
'<'
]
=
anc
;
m_marks
[
'<'
]
=
anc
;
m_marks
[
'>'
]
=
pos
;
m_marks
[
'>'
]
=
pos
;
m_anchor
=
anc
;
m_anchor
=
anc
;
...
@@ -1060,7 +1062,7 @@ void FakeVimHandler::Private::restoreWidget(int tabSize)
...
@@ -1060,7 +1062,7 @@ void FakeVimHandler::Private::restoreWidget(int tabSize)
m_tc
.
setPosition
(
firstPositionInLine
(
beginLine
),
MoveAnchor
);
m_tc
.
setPosition
(
firstPositionInLine
(
beginLine
),
MoveAnchor
);
m_tc
.
setPosition
(
lastPositionInLine
(
endLine
),
KeepAnchor
);
m_tc
.
setPosition
(
lastPositionInLine
(
endLine
),
KeepAnchor
);
EDITOR
(
setTextCursor
(
m_tc
));
EDITOR
(
setTextCursor
(
m_tc
));
}
else
if
(
isVisualCharMode
())
{
}
else
if
(
isVisualCharMode
()
||
isVisualBlockMode
()
)
{
m_tc
=
EDITOR
(
textCursor
());
m_tc
=
EDITOR
(
textCursor
());
m_tc
.
setPosition
(
m_marks
[
'<'
],
MoveAnchor
);
m_tc
.
setPosition
(
m_marks
[
'<'
],
MoveAnchor
);
m_tc
.
setPosition
(
m_marks
[
'>'
],
KeepAnchor
);
m_tc
.
setPosition
(
m_marks
[
'>'
],
KeepAnchor
);
...
...
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