diff options
-rw-r--r-- | editor/code_editor.cpp | 7 | ||||
-rw-r--r-- | editor/editor_audio_buses.cpp | 13 | ||||
-rw-r--r-- | editor/editor_audio_buses.h | 1 | ||||
-rw-r--r-- | modules/regex/doc_classes/RegEx.xml | 3 | ||||
-rw-r--r-- | modules/regex/doc_classes/RegExMatch.xml | 2 | ||||
-rw-r--r-- | platform/javascript/javascript_main.cpp | 12 |
6 files changed, 28 insertions, 10 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 1b2b0a26e6..95c7cc0bf1 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -307,18 +307,19 @@ void FindReplaceBar::_update_results_count() { break; } + int pos_subsequent = pos + searched.length(); if (is_whole_words()) { from_pos = pos + 1; // Making sure we won't hit the same match next time, if we get out via a continue. - if (pos > 0 && !is_symbol(full_text[pos - 1])) { + if (pos > 0 && !(is_symbol(full_text[pos - 1]) || full_text[pos - 1] == '\n')) { continue; } - if (pos + searched.length() < full_text.length() && !is_symbol(full_text[pos + searched.length()])) { + if (pos_subsequent < full_text.length() && !(is_symbol(full_text[pos_subsequent]) || full_text[pos_subsequent] == '\n')) { continue; } } results_count++; - from_pos = pos + searched.length(); + from_pos = pos_subsequent; } } diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index f8dec13a5c..5cf5201b18 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -545,6 +545,17 @@ void EditorAudioBus::_gui_input(const Ref<InputEvent> &p_event) { } } +void EditorAudioBus::_unhandled_key_input(Ref<InputEvent> p_event) { + Ref<InputEventKey> k = p_event; + if (k.is_valid() && k->is_pressed() && !k->is_echo() && k->get_keycode() == KEY_DELETE) { + TreeItem *current_effect = effects->get_selected(); + if (current_effect && current_effect->get_metadata(0).get_type() == Variant::INT) { + _delete_effect_pressed(0); + accept_event(); + } + } +} + void EditorAudioBus::_bus_popup_pressed(int p_option) { if (p_option == 2) { // Reset volume @@ -738,6 +749,7 @@ void EditorAudioBus::_bind_methods() { ClassDB::bind_method("update_bus", &EditorAudioBus::update_bus); ClassDB::bind_method("update_send", &EditorAudioBus::update_send); ClassDB::bind_method("_gui_input", &EditorAudioBus::_gui_input); + ClassDB::bind_method("_unhandled_key_input", &EditorAudioBus::_unhandled_key_input); ClassDB::bind_method("get_drag_data_fw", &EditorAudioBus::get_drag_data_fw); ClassDB::bind_method("can_drop_data_fw", &EditorAudioBus::can_drop_data_fw); ClassDB::bind_method("drop_data_fw", &EditorAudioBus::drop_data_fw); @@ -761,6 +773,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { add_child(vb); set_v_size_flags(SIZE_EXPAND_FILL); + set_process_unhandled_key_input(true); track_name = memnew(LineEdit); track_name->connect("text_entered", callable_mp(this, &EditorAudioBus::_name_changed)); diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index 6b2d9e4436..65caf84f0f 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -92,6 +92,7 @@ class EditorAudioBus : public PanelContainer { mutable bool hovering_drop; void _gui_input(const Ref<InputEvent> &p_event); + void _unhandled_key_input(Ref<InputEvent> p_event); void _bus_popup_pressed(int p_option); void _name_changed(const String &p_new_name); diff --git a/modules/regex/doc_classes/RegEx.xml b/modules/regex/doc_classes/RegEx.xml index 3130c53331..c00fa96b2e 100644 --- a/modules/regex/doc_classes/RegEx.xml +++ b/modules/regex/doc_classes/RegEx.xml @@ -32,8 +32,7 @@ [codeblock] for result in regex.search_all("d01, d03, d0c, x3f and x42"): print(result.get_string("digit")) - # Would print 01 03 3f 42 - # Note that d0c would not match + # Would print 01 03 0 3f 42 [/codeblock] [b]Note:[/b] Godot's regex implementation is based on the [url=https://www.pcre.org/]PCRE2[/url] library. You can view the full pattern reference [url=https://www.pcre.org/current/doc/html/pcre2pattern.html]here[/url]. [b]Tip:[/b] You can use [url=https://regexr.com/]Regexr[/url] to test regular expressions online. diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml index 151e881b6f..a45de60aef 100644 --- a/modules/regex/doc_classes/RegExMatch.xml +++ b/modules/regex/doc_classes/RegExMatch.xml @@ -49,7 +49,7 @@ </methods> <members> <member name="names" type="Dictionary" setter="" getter="get_names" default="{}"> - A dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. + A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. </member> <member name="strings" type="Array" setter="" getter="get_strings" default="[ ]"> An [Array] of the match and its capturing groups. diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index 740a72fafa..fd61c46e63 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -80,6 +80,9 @@ extern "C" EMSCRIPTEN_KEEPALIVE void main_after_fs_sync(char *p_idbfs_err) { Main::start(); os->get_main_loop()->init(); emscripten_resume_main_loop(); + // Immediately run the first iteration. + // We are inside an animation frame, we want to immediately draw on the newly setup canvas. + main_loop_callback(); } int main(int argc, char *argv[]) { @@ -91,14 +94,15 @@ int main(int argc, char *argv[]) { // Sync from persistent state into memory and then // run the 'main_after_fs_sync' function. /* clang-format off */ - EM_ASM( + EM_ASM({ FS.mkdir('/userfs'); FS.mount(IDBFS, {}, '/userfs'); FS.syncfs(true, function(err) { - ccall('main_after_fs_sync', null, ['string'], [err ? err.message : ""]) + requestAnimationFrame(function() { + ccall('main_after_fs_sync', null, ['string'], [err ? err.message : ""]); + }); }); - - ); + }); /* clang-format on */ return 0; |