Fix "index -1 out of range" error spam when the Editor is using translations. Fixes #24277
This commit is contained in:
parent
fa024537a3
commit
1884952ae3
1 changed files with 2 additions and 2 deletions
|
@ -1078,7 +1078,7 @@ void ScriptTextEditor::set_syntax_highlighter(SyntaxHighlighter *p_highlighter)
|
||||||
if (p_highlighter != NULL)
|
if (p_highlighter != NULL)
|
||||||
highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text(p_highlighter->get_name()), true);
|
highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text(p_highlighter->get_name()), true);
|
||||||
else
|
else
|
||||||
highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text("Standard"), true);
|
highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text(TTR("Standard")), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptTextEditor::_change_syntax_highlighter(int p_idx) {
|
void ScriptTextEditor::_change_syntax_highlighter(int p_idx) {
|
||||||
|
@ -1512,7 +1512,7 @@ ScriptTextEditor::ScriptTextEditor() {
|
||||||
convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize"), KEY_MASK_SHIFT | KEY_F6), EDIT_CAPITALIZE);
|
convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize"), KEY_MASK_SHIFT | KEY_F6), EDIT_CAPITALIZE);
|
||||||
convert_case->connect("id_pressed", this, "_edit_option");
|
convert_case->connect("id_pressed", this, "_edit_option");
|
||||||
|
|
||||||
highlighters["Standard"] = NULL;
|
highlighters[TTR("Standard")] = NULL;
|
||||||
highlighter_menu = memnew(PopupMenu);
|
highlighter_menu = memnew(PopupMenu);
|
||||||
highlighter_menu->set_name("highlighter_menu");
|
highlighter_menu->set_name("highlighter_menu");
|
||||||
edit_menu->get_popup()->add_child(highlighter_menu);
|
edit_menu->get_popup()->add_child(highlighter_menu);
|
||||||
|
|
Loading…
Reference in a new issue