[gnome-builder] libide: add "Reformat code on save" editor option
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: add "Reformat code on save" editor option
- Date: Mon, 8 Nov 2021 21:18:27 +0000 (UTC)
commit 2c8f3d0bc3adc134c9a663ea7f8c297ead646880
Author: Tomi Lähteenmäki <lihis lihis net>
Date: Sat Nov 6 14:32:14 2021 +0200
libide: add "Reformat code on save" editor option
data/gsettings/org.gnome.builder.gschema.xml | 3 +++
src/libide/code/ide-file-settings.defs | 1 -
src/libide/gui/ide-preferences-builtin.c | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/data/gsettings/org.gnome.builder.gschema.xml b/data/gsettings/org.gnome.builder.gschema.xml
index e687d3baf..24fa95836 100644
--- a/data/gsettings/org.gnome.builder.gschema.xml
+++ b/data/gsettings/org.gnome.builder.gschema.xml
@@ -48,5 +48,8 @@
<summary>Clear build caches at startup</summary>
<description>If enabled, Builder will clear build caches upon startup.</description>
</key>
+ <key name="format-on-save" type="b">
+ <default>false</default>
+ </key>
</schema>
</schemalist>
diff --git a/src/libide/code/ide-file-settings.defs b/src/libide/code/ide-file-settings.defs
index 4682acc0b..ab9886c7d 100644
--- a/src/libide/code/ide-file-settings.defs
+++ b/src/libide/code/ide-file-settings.defs
@@ -149,4 +149,3 @@ IDE_FILE_SETTINGS_PROPERTY (TRIM_TRAILING_WHITESPACE, trim_trailing_whitespace,
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)),
priv->trim_trailing_whitespace = !!trim_trailing_whitespace;,
boolean)
-
diff --git a/src/libide/gui/ide-preferences-builtin.c b/src/libide/gui/ide-preferences-builtin.c
index bdd471a90..de0e2f00f 100644
--- a/src/libide/gui/ide-preferences-builtin.c
+++ b/src/libide/gui/ide-preferences-builtin.c
@@ -151,6 +151,7 @@ ide_preferences_builtin_register_editor (DzlPreferences *preferences)
dzl_preferences_add_list_group (preferences, "editor", "general", _("General"), GTK_SELECTION_NONE, -5);
dzl_preferences_add_switch (preferences, "editor", "general", "org.gnome.builder", "show-open-files",
NULL, NULL, _("Display list of open files"), _("Display the list of all open files in the project sidebar"),
NULL, 0);
+ dzl_preferences_add_switch (preferences, "editor", "general", "org.gnome.builder", "format-on-save", NULL,
NULL, _("Reformat code on save"), _("Reformat current file on save"), NULL, 5);
dzl_preferences_add_list_group (preferences, "editor", "position", _("Cursor"), GTK_SELECTION_NONE, 0);
dzl_preferences_add_switch (preferences, "editor", "position", "org.gnome.builder.editor",
"restore-insert-mark", NULL, NULL, _("Restore cursor position"), _("Restore cursor position when a file is
reopened"), NULL, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]