Fixed issues with Editor Log after recent changes

Fixed #48446, Fixed #48443
This commit is contained in:
Eric M 2021-05-05 00:25:14 +10:00
parent ea9cab3e76
commit 87ffb213c8
2 changed files with 5 additions and 1 deletions

View file

@ -224,7 +224,7 @@ void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) {
log->add_text(p_message.text);
// Need to use pop() to exit out of the RichTextLabels current "push" stack.
// We only "push" in the above swicth when message type != STD, so only pop when that is the case.
// We only "push" in the above switch when message type != STD, so only pop when that is the case.
if (p_message.type != MSG_TYPE_STD) {
log->pop();
}
@ -298,6 +298,7 @@ EditorLog::EditorLog() {
clear_button->set_flat(true);
clear_button->set_focus_mode(FOCUS_NONE);
clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_K));
clear_button->set_shortcut_context(this);
clear_button->connect("pressed", callable_mp(this, &EditorLog::_clear_request));
hb_tools->add_child(clear_button);
@ -306,6 +307,7 @@ EditorLog::EditorLog() {
copy_button->set_flat(true);
copy_button->set_focus_mode(FOCUS_NONE);
copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KEY_MASK_CMD | KEY_C));
copy_button->set_shortcut_context(this);
copy_button->connect("pressed", callable_mp(this, &EditorLog::_copy_request));
hb_tools->add_child(copy_button);
@ -331,6 +333,7 @@ EditorLog::EditorLog() {
show_search_button->set_toggle_mode(true);
show_search_button->set_pressed(true);
show_search_button->set_shortcut(ED_SHORTCUT("editor/open_search", TTR("Open the search box."), KEY_MASK_CMD | KEY_F));
show_search_button->set_shortcut_context(this);
show_search_button->connect("toggled", callable_mp(this, &EditorLog::_set_search_visible));
hb_tools2->add_child(show_search_button);

View file

@ -2615,6 +2615,7 @@ void RichTextLabel::pop() {
// Creates a new line without adding an ItemNewline to the previous line.
// Useful when wanting to calling remove_line and add a new line immediately after.
void RichTextLabel::increment_line_count() {
_validate_line_caches(main);
current_frame->lines.resize(current_frame->lines.size() + 1);
_invalidate_current_line(current_frame);
}