From 5839186aa5cdbac404631f3387a49d82032a4179 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 8 Nov 2015 19:13:41 +0100 Subject: [PATCH] Added *_user_action to trailing whitespace stripping. --- src/notebook.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/notebook.cc b/src/notebook.cc index c72627a..29fcdc9 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -175,6 +175,7 @@ bool Notebook::save(int page, bool reparse_needed) { //strip trailing whitespaces and add trailing newline if missing if(Singleton::config->source.strip_trailing_whitespaces) { auto buffer=view->get_buffer(); + buffer->begin_user_action(); for(int line=0;lineget_line_count();line++) { auto iter=buffer->get_iter_at_line(line); auto end_iter=iter; @@ -194,6 +195,7 @@ bool Notebook::save(int page, bool reparse_needed) { auto iter=buffer->end(); if(!iter.starts_line()) buffer->insert(buffer->end(), "\n"); + buffer->end_user_action(); } if(filesystem::write(view->file_path, view->get_buffer())) {