Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Dialogs/PreferencesDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions src/Services/Document.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down