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
Tobias Hunger
qt-creator
Commits
b11d3606
Commit
b11d3606
authored
Jul 02, 2009
by
Thorbjørn Lindeijer
Browse files
Fixed behaviour of Home and End while renaming
Also allow starting to rename with the cursor at the end of the name.
parent
560b0639
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
b11d3606
...
...
@@ -805,7 +805,7 @@ void CPPEditor::renameInPlace()
for
(
int
i
=
0
;
i
<
m_renameSelections
.
size
();
++
i
)
{
QTextEdit
::
ExtraSelection
s
=
m_renameSelections
.
at
(
i
);
if
(
c
.
position
()
>=
s
.
cursor
.
anchor
()
&&
c
.
position
()
<
s
.
cursor
.
position
())
{
&&
c
.
position
()
<
=
s
.
cursor
.
position
())
{
m_currentRenameSelection
=
i
;
m_renameSelections
[
i
].
format
.
setBackground
(
QColor
(
255
,
200
,
200
));
setExtraSelections
(
CodeSemanticsSelection
,
m_renameSelections
);
...
...
@@ -1471,17 +1471,25 @@ void CPPEditor::keyPressEvent(QKeyEvent *e)
return
;
case
Qt
::
Key_Home
:
{
QTextCursor
c
=
textCursor
();
c
.
setPosition
(
currentRenameSelection
.
cursor
.
anchor
(),
moveMode
);
setTextCursor
(
c
);
e
->
accept
();
return
;
if
(
c
.
position
()
>
currentRenameSelection
.
cursor
.
anchor
()
&&
c
.
position
()
<=
currentRenameSelection
.
cursor
.
position
())
{
c
.
setPosition
(
currentRenameSelection
.
cursor
.
anchor
(),
moveMode
);
setTextCursor
(
c
);
e
->
accept
();
return
;
}
break
;
}
case
Qt
::
Key_End
:
{
QTextCursor
c
=
textCursor
();
c
.
setPosition
(
currentRenameSelection
.
cursor
.
position
(),
moveMode
);
setTextCursor
(
c
);
e
->
accept
();
return
;
if
(
c
.
position
()
>=
currentRenameSelection
.
cursor
.
anchor
()
&&
c
.
position
()
<
currentRenameSelection
.
cursor
.
position
())
{
c
.
setPosition
(
currentRenameSelection
.
cursor
.
position
(),
moveMode
);
setTextCursor
(
c
);
e
->
accept
();
return
;
}
break
;
}
case
Qt
::
Key_Backspace
:
{
QTextCursor
c
=
textCursor
();
...
...
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