@@ -79,16 +79,22 @@ func _gui_input(event):
79
79
match event .as_text ():
80
80
"Ctrl+K" :
81
81
toggle_comment ()
82
+
83
+ # TODO clean this up when dropping 4.2 support
82
84
"Alt+Up" :
83
- move_lines_up ()
85
+ if has_method ("move_lines_up" ):
86
+ call ("move_lines_up" )
84
87
"Alt+Down" :
85
- move_lines_down ()
88
+ if has_method ("move_lines_down" ):
89
+ call ("move_lines_down" )
90
+
86
91
"Ctrl+Shift+D" , "Ctrl+D" :
87
92
duplicate_lines ()
88
93
_ :
89
94
return
90
95
get_viewport ().set_input_as_handled ()
91
96
97
+
92
98
# Toggle the selected lines as comments
93
99
func toggle_comment () -> void :
94
100
var cursor : Vector2 = Vector2 (get_caret_column (), get_caret_line ())
@@ -128,14 +134,14 @@ func toggle_comment() -> void:
128
134
text_changed .emit ()
129
135
130
136
131
- # Allows dragging files into the editor
137
+ ## Allows dragging files into the editor
132
138
func _can_drop_data (at_position :Vector2 , data :Variant ) -> bool :
133
139
if typeof (data ) == TYPE_DICTIONARY and 'files' in data .keys () and len (data .files ) == 1 :
134
140
return true
135
141
return false
136
142
137
143
138
- # Allows dragging files into the editor
144
+ ## Allows dragging files into the editor
139
145
func _drop_data (at_position :Vector2 , data :Variant ) -> void :
140
146
if typeof (data ) == TYPE_DICTIONARY and 'files' in data .keys () and len (data .files ) == 1 :
141
147
set_caret_column (get_line_column_at_pos (at_position ).x )
@@ -232,19 +238,19 @@ func search_navigate(navigate_up := false) -> void:
232
238
## AUTO COMPLETION
233
239
## ##############################################################################
234
240
235
- # Called if something was typed
241
+ ## Called if something was typed
236
242
func _request_code_completion (force :bool ):
237
243
code_completion_helper .request_code_completion (force , self )
238
244
239
245
240
- # Filters the list of all possible options, depending on what was typed
241
- # Purpose of the different Kinds is explained in [_request_code_completion]
246
+ ## Filters the list of all possible options, depending on what was typed
247
+ ## Purpose of the different Kinds is explained in [_request_code_completion]
242
248
func _filter_code_completion_candidates (candidates :Array ) -> Array :
243
249
return code_completion_helper .filter_code_completion_candidates (candidates , self )
244
250
245
251
246
- # Called when code completion was activated
247
- # Inserts the selected item
252
+ ## Called when code completion was activated
253
+ ## Inserts the selected item
248
254
func _confirm_code_completion (replace :bool ) -> void :
249
255
code_completion_helper .confirm_code_completion (replace , self )
250
256
@@ -253,11 +259,11 @@ func _confirm_code_completion(replace:bool) -> void:
253
259
## SYMBOL CLICKING
254
260
## ##############################################################################
255
261
256
- # Performs an action (like opening a link) when a valid symbol was clicked
262
+ ## Performs an action (like opening a link) when a valid symbol was clicked
257
263
func _on_symbol_lookup (symbol , line , column ):
258
264
code_completion_helper .symbol_lookup (symbol , line , column )
259
265
260
266
261
- # Called to test if a symbol can be clicked
267
+ ## Called to test if a symbol can be clicked
262
268
func _on_symbol_validate (symbol :String ) -> void :
263
269
code_completion_helper .symbol_validate (symbol , self )
0 commit comments