summaryrefslogtreecommitdiffstats
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
authorAlfred Reinold Baudisch <alfred@alfredbaudisch.com>2022-12-06 10:23:11 +0100
committerAlfred Reinold Baudisch <alfred@alfredbaudisch.com>2022-12-06 12:45:25 +0100
commit02f7e03a6632182b2765da61182e9912dd826cbe (patch)
tree99b58ef636f6b4b24f4b296c9f8e93be2e0c4d63 /editor/code_editor.cpp
parentf3e6750a7e4702918e05f42b1376e30e652f2f90 (diff)
downloadredot-engine-02f7e03a6632182b2765da61182e9912dd826cbe.tar.gz
Cancels the code complete timer when the caret moves to another line
Fixes and closes #68961
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r--editor/code_editor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 926c01b334..7ae0db7b48 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -873,6 +873,10 @@ void CodeTextEditor::_reset_zoom() {
}
void CodeTextEditor::_line_col_changed() {
+ if (!code_complete_timer->is_stopped() && code_complete_timer_line != text_editor->get_caret_line()) {
+ code_complete_timer->stop();
+ }
+
String line = text_editor->get_line(text_editor->get_caret_line());
int positional_column = 0;
@@ -902,6 +906,7 @@ void CodeTextEditor::_line_col_changed() {
void CodeTextEditor::_text_changed() {
if (text_editor->is_insert_text_operation()) {
+ code_complete_timer_line = text_editor->get_caret_line();
code_complete_timer->start();
}