diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-05-22 18:01:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-22 18:01:51 +0200 |
commit | 97d433a27214e5b3cdac5d0119238d3d6d6e0241 (patch) | |
tree | 7409ea43b3b272d1c4f15cc8fbcdd94884359159 | |
parent | 4828667759bca621570862d05e95316235bb05e4 (diff) | |
parent | a6ff00d8bedf82318b285fb901d49099102d48c0 (diff) |
Merge pull request #48970 from EricEzaM/more-editor-log-fixes
Fixed editor log collapsing of duplicate messages not working
-rw-r--r-- | editor/editor_log.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 469fb41406..622b3fe355 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -234,7 +234,9 @@ void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) { if (p_replace_previous) { // Remove last line if replacing, as it will be replace by the next added line. - log->remove_line(log->get_line_count() - 1); + // Why - 2? RichTextLabel is weird. When you add a line, it also adds a NEW line, which is null, + // but it still counts as a line. So if you remove the last line (count - 1) you are actually removing nothing... + log->remove_line(log->get_line_count() - 2); log->increment_line_count(); } |