diff --git a/src/Dialogs/PreferencesDialog.vala b/src/Dialogs/PreferencesDialog.vala index 7df2cd800..96bc5def6 100644 --- a/src/Dialogs/PreferencesDialog.vala +++ b/src/Dialogs/PreferencesDialog.vala @@ -22,7 +22,11 @@ public class Scratch.Dialogs.Preferences : Granite.Dialog { var general_box = new Gtk.Box (VERTICAL, 12); general_box.add (new Granite.HeaderLabel (_("General"))); general_box.add (new SettingSwitch (_("Save files when changed"), "autosave")); - general_box.add (new SettingSwitch (_("Strip trailing whitespace on save"), "strip-trailing-on-save")); + general_box.add (new SettingSwitch ( + _("Strip trailing whitespace on save"), + "strip-trailing-on-save", + _("Except Plain Text, Markdown and YAML") + )); general_box.add (new SettingSwitch ( _("Smart cut/copy lines"), "smart-cut-copy", diff --git a/src/Services/Document.vala b/src/Services/Document.vala index 7c110ea7f..0b5ddbe1c 100644 --- a/src/Services/Document.vala +++ b/src/Services/Document.vala @@ -1319,6 +1319,11 @@ namespace Scratch.Services { return; } + var lang_id = source_view.language.id; + if (lang_id == "markdown" || lang_id == "yaml") { + return; + } + var source_buffer = (Gtk.SourceBuffer)source_view.buffer; Gtk.TextIter iter;