|
@@ -2431,6 +2431,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) {
|
|
|
|
|
|
if (k.mod.shift)
|
|
if (k.mod.shift)
|
|
_post_shift_selection();
|
|
_post_shift_selection();
|
|
|
|
+ else if(k.mod.command || k.mod.control)
|
|
|
|
+ deselect();
|
|
|
|
|
|
} break;
|
|
} break;
|
|
#else
|
|
#else
|
|
@@ -2440,25 +2442,30 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) {
|
|
if (k.mod.shift)
|
|
if (k.mod.shift)
|
|
_pre_shift_selection();
|
|
_pre_shift_selection();
|
|
|
|
|
|
- // compute whitespace symbols seq length
|
|
|
|
- int current_line_whitespace_len = 0;
|
|
|
|
- while(current_line_whitespace_len < text[cursor.line].length()) {
|
|
|
|
- CharType c = text[cursor.line][current_line_whitespace_len];
|
|
|
|
- if(c != '\t' && c != ' ')
|
|
|
|
- break;
|
|
|
|
- current_line_whitespace_len++;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(cursor_get_column() == current_line_whitespace_len)
|
|
|
|
|
|
+ if (k.mod.command) {
|
|
|
|
+ cursor_set_line(0);
|
|
cursor_set_column(0);
|
|
cursor_set_column(0);
|
|
- else
|
|
|
|
- cursor_set_column(current_line_whitespace_len);
|
|
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ // compute whitespace symbols seq length
|
|
|
|
+ int current_line_whitespace_len = 0;
|
|
|
|
+ while( current_line_whitespace_len < text[cursor.line].length() ) {
|
|
|
|
+ CharType c = text[cursor.line][current_line_whitespace_len];
|
|
|
|
+ if( c != '\t' && c != ' ' )
|
|
|
|
+ break;
|
|
|
|
+ current_line_whitespace_len++;
|
|
|
|
+ }
|
|
|
|
|
|
- if (k.mod.command)
|
|
|
|
- cursor_set_line(0);
|
|
|
|
|
|
+ if( cursor_get_column() == current_line_whitespace_len )
|
|
|
|
+ cursor_set_column(0);
|
|
|
|
+ else
|
|
|
|
+ cursor_set_column(current_line_whitespace_len);
|
|
|
|
+ }
|
|
|
|
|
|
if (k.mod.shift)
|
|
if (k.mod.shift)
|
|
_post_shift_selection();
|
|
_post_shift_selection();
|
|
|
|
+ else if(k.mod.command || k.mod.control)
|
|
|
|
+ deselect();
|
|
_cancel_completion();
|
|
_cancel_completion();
|
|
completion_hint="";
|
|
completion_hint="";
|
|
|
|
|
|
@@ -2481,6 +2488,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) {
|
|
|
|
|
|
if (k.mod.shift)
|
|
if (k.mod.shift)
|
|
_post_shift_selection();
|
|
_post_shift_selection();
|
|
|
|
+ else if(k.mod.command || k.mod.control)
|
|
|
|
+ deselect();
|
|
|
|
|
|
} break;
|
|
} break;
|
|
#else
|
|
#else
|
|
@@ -2495,6 +2504,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) {
|
|
|
|
|
|
if (k.mod.shift)
|
|
if (k.mod.shift)
|
|
_post_shift_selection();
|
|
_post_shift_selection();
|
|
|
|
+ else if(k.mod.command || k.mod.control)
|
|
|
|
+ deselect();
|
|
|
|
|
|
_cancel_completion();
|
|
_cancel_completion();
|
|
completion_hint="";
|
|
completion_hint="";
|