[gnome-builder/wip/gtk4-port] plugins/editorui: cleanup tab/space label
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] plugins/editorui: cleanup tab/space label
- Date: Wed, 1 Jun 2022 22:31:37 +0000 (UTC)
commit ddae7132af6721fa1b51c9a0363073b232f5870e
Author: Christian Hergert <chergert redhat com>
Date: Wed Jun 1 15:31:30 2022 -0700
plugins/editorui: cleanup tab/space label
src/plugins/editorui/gbp-editorui-workspace-addin.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/editorui/gbp-editorui-workspace-addin.c
b/src/plugins/editorui/gbp-editorui-workspace-addin.c
index 414502c85..f5762d822 100644
--- a/src/plugins/editorui/gbp-editorui-workspace-addin.c
+++ b/src/plugins/editorui/gbp-editorui-workspace-addin.c
@@ -143,9 +143,15 @@ notify_indentation_cb (GbpEditoruiWorkspaceAddin *self)
if (indent_width <= 0)
indent_width = tab_width;
- label = g_strdup_printf ("%s %u:%u",
- insert_spaces_instead_of_tabs ? _("Space") : _("Tab"),
- indent_width, tab_width);
+ if (indent_width < 0 || indent_width == (int)tab_width)
+ label = g_strdup_printf ("%s: %u",
+ insert_spaces_instead_of_tabs ? _("Spaces") : _("Tabs"),
+ tab_width);
+ else
+ label = g_strdup_printf ("%s: %u:%u",
+ insert_spaces_instead_of_tabs ? _("Spaces") : _("Tabs"),
+ tab_width, indent_width);
+
gtk_label_set_label (self->indentation_label, label);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]