summaryrefslogtreecommitdiff
path: root/scene/gui/code_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/code_edit.cpp')
-rw-r--r--scene/gui/code_edit.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp
index 05bb30f7e0..197c9005c3 100644
--- a/scene/gui/code_edit.cpp
+++ b/scene/gui/code_edit.cpp
@@ -357,6 +357,11 @@ void CodeEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
}
Ref<InputEventKey> k = p_gui_input;
+ if (TextEdit::alt_input(p_gui_input)) {
+ accept_event();
+ return;
+ }
+
bool update_code_completion = false;
if (!k.is_valid()) {
TextEdit::gui_input(p_gui_input);
@@ -735,7 +740,7 @@ void CodeEdit::set_auto_indent_prefixes(const TypedArray<String> &p_prefixes) {
TypedArray<String> CodeEdit::get_auto_indent_prefixes() const {
TypedArray<String> prefixes;
- for (const Set<char32_t>::Element *E = auto_indent_prefixes.front(); E; E = E->next()) {
+ for (const RBSet<char32_t>::Element *E = auto_indent_prefixes.front(); E; E = E->next()) {
prefixes.push_back(String::chr(E->get()));
}
return prefixes;
@@ -1623,7 +1628,7 @@ Point2 CodeEdit::get_delimiter_start_position(int p_line, int p_column) const {
start_position.y = -1;
start_position.x = -1;
- bool in_region = ((p_line <= 0 || delimiter_cache[p_line - 1].size() < 1) ? -1 : delimiter_cache[p_line - 1].back()->value()) != -1;
+ bool in_region = ((p_line <= 0 || delimiter_cache[p_line - 1].size() < 1) ? -1 : delimiter_cache[p_line - 1].back()->get()) != -1;
/* Check the keys for this line. */
for (const KeyValue<int, int> &E : delimiter_cache[p_line]) {
@@ -1747,7 +1752,7 @@ void CodeEdit::set_code_completion_prefixes(const TypedArray<String> &p_prefixes
TypedArray<String> CodeEdit::get_code_completion_prefixes() const {
TypedArray<String> prefixes;
- for (const Set<char32_t>::Element *E = code_completion_prefixes.front(); E; E = E->next()) {
+ for (const RBSet<char32_t>::Element *E = code_completion_prefixes.front(); E; E = E->next()) {
prefixes.push_back(String::chr(E->get()));
}
return prefixes;
@@ -2397,7 +2402,7 @@ void CodeEdit::_update_delimiter_cache(int p_from_line, int p_to_line) {
}
} else {
for (int i = start_line; i < end_line; i++) {
- delimiter_cache.insert(i, Map<int, int>());
+ delimiter_cache.insert(i, RBMap<int, int>());
}
}
}
@@ -2534,7 +2539,7 @@ int CodeEdit::_is_in_delimiter(int p_line, int p_column, DelimiterType p_type) c
int region = (p_line <= 0 || delimiter_cache[p_line - 1].size() < 1) ? -1 : delimiter_cache[p_line - 1].back()->value();
bool in_region = region != -1 && delimiters[region].type == p_type;
- for (Map<int, int>::Element *E = delimiter_cache[p_line].front(); E; E = E->next()) {
+ for (RBMap<int, int>::Element *E = delimiter_cache[p_line].front(); E; E = E->next()) {
/* If column is specified, loop until the key is larger then the column. */
if (p_column != -1) {
if (E->key() > p_column) {
@@ -3036,7 +3041,9 @@ void CodeEdit::_text_changed() {
lc = get_line_count();
List<int> breakpoints;
- breakpointed_lines.get_key_list(&breakpoints);
+ for (const KeyValue<int, bool> &E : breakpointed_lines) {
+ breakpoints.push_back(E.key);
+ }
for (const int &line : breakpoints) {
if (line < lines_edited_from || (line < lc && is_line_breakpointed(line))) {
continue;