Selected text is now deselected on ctrl+home/end

This fixes Issue #7694 and also the error mentioned in the comments of that issue.

(cherry picked from commit 1169f4e040)
This commit is contained in:
kbake 2017-02-03 02:01:41 -05:00 committed by Rémi Verschelde
parent 97fef612fb
commit 31260bb720

View file

@ -2370,6 +2370,8 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
if (k.mod.shift)
_post_shift_selection();
else if(k.mod.command || k.mod.control)
deselect();
} break;
#else
@ -2379,6 +2381,11 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
if (k.mod.shift)
_pre_shift_selection();
if (k.mod.command) {
cursor_set_line(0);
cursor_set_column(0);
}
else {
// compute whitespace symbols seq length
int current_line_whitespace_len = 0;
while( current_line_whitespace_len < text[cursor.line].length() ) {
@ -2392,12 +2399,12 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
cursor_set_column(0);
else
cursor_set_column(current_line_whitespace_len);
if (k.mod.command)
cursor_set_line(0);
}
if (k.mod.shift)
_post_shift_selection();
else if(k.mod.command || k.mod.control)
deselect();
_cancel_completion();
completion_hint="";
@ -2420,6 +2427,8 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
if (k.mod.shift)
_post_shift_selection();
else if(k.mod.command || k.mod.control)
deselect();
} break;
#else
@ -2434,6 +2443,8 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
if (k.mod.shift)
_post_shift_selection();
else if(k.mod.command || k.mod.control)
deselect();
_cancel_completion();
completion_hint="";