summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorTwarit Waikar <wtwarit@gmail.com>2022-12-23 02:05:23 +0530
committerTwarit Waikar <wtwarit@gmail.com>2022-12-23 02:20:01 +0530
commit7ef09ea88fd752f960e04297acc756f2c3c588e3 (patch)
tree515c73dec92420c211b19b881aa4aae35686f760 /editor/plugins
parent291add339f0228d58226def25c38ea4fdcea6fb5 (diff)
VCS: Fix split diff's overlapping fields
Also adjusts the spacing nearby the diff contents.
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index f54bebfd8e..e9c6184d73 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -594,7 +594,6 @@ void VersionControlEditorPlugin::_display_diff(int p_idx) {
diff->pop();
diff->pop();
- diff->add_newline();
diff->push_font(EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
for (int j = 0; j < diff_file.diff_hunks.size(); j++) {
EditorVCSInterface::DiffHunk hunk = diff_file.diff_hunks[j];
@@ -604,6 +603,7 @@ void VersionControlEditorPlugin::_display_diff(int p_idx) {
String old_lines = String::num_int64(hunk.old_lines);
String new_lines = String::num_int64(hunk.new_lines);
+ diff->add_newline();
diff->append_text("[center]@@ " + old_start + "," + old_lines + " " + new_start + "," + new_lines + " @@[/center]");
diff->add_newline();
@@ -616,7 +616,6 @@ void VersionControlEditorPlugin::_display_diff(int p_idx) {
break;
}
diff->add_newline();
- diff->add_newline();
}
diff->pop();
@@ -684,12 +683,10 @@ void VersionControlEditorPlugin::_display_diff_split_view(List<EditorVCSInterfac
if (diff_line.old_line_no >= 0) {
diff->push_cell();
- diff->push_indent(1);
diff->push_color(has_change ? red : white);
diff->add_text(String::num_int64(diff_line.old_line_no));
diff->pop();
diff->pop();
- diff->pop();
diff->push_cell();
diff->push_color(has_change ? red : white);
@@ -716,12 +713,10 @@ void VersionControlEditorPlugin::_display_diff_split_view(List<EditorVCSInterfac
if (diff_line.new_line_no >= 0) {
diff->push_cell();
- diff->push_indent(1);
diff->push_color(has_change ? green : white);
diff->add_text(String::num_int64(diff_line.new_line_no));
diff->pop();
diff->pop();
- diff->pop();
diff->push_cell();
diff->push_color(has_change ? green : white);