diff --git a/src/config.cc b/src/config.cc index 19077ad..4883f23 100644 --- a/src/config.cc +++ b/src/config.cc @@ -146,7 +146,7 @@ void Config::get_source() { source.style=source_json.get("style"); source.font=source_json.get("font"); - source.strip_trailing_whitespaces=source_json.get("strip_trailing_whitespaces"); + source.cleanup_whitespace_characters=source_json.get("cleanup_whitespace_characters"); source.show_map = source_json.get("show_map"); source.map_font_size = source_json.get("map_font_size"); diff --git a/src/config.h b/src/config.h index 4ad5f2e..0bfb91d 100644 --- a/src/config.h +++ b/src/config.h @@ -49,7 +49,7 @@ public: std::string font; std::string spellcheck_language; - bool strip_trailing_whitespaces; + bool cleanup_whitespace_characters; bool show_map; std::string map_font_size; diff --git a/src/files.h b/src/files.h index fa38779..a14f680 100644 --- a/src/files.h +++ b/src/files.h @@ -29,8 +29,8 @@ const std::string configjson = " \"font\": \"Monospace\",\n" #endif #endif -" \"strip_trailing_whitespaces_comment\": \"Remove trailing whitespace characters on save, and add trailing newline if missing\",\n" -" \"strip_trailing_whitespaces\": false,\n" +" \"cleanup_whitespace_characters_comment\": \"Remove trailing whitespace characters on save, and add trailing newline if missing\",\n" +" \"cleanup_whitespace_characters\": false,\n" " \"show_map\": true,\n" " \"map_font_size\": \"1\",\n" " \"spellcheck_language_comment\": \"Use \\\"\\\" to set language from your locale settings\",\n" diff --git a/src/notebook.cc b/src/notebook.cc index 4703fd6..6fd29d9 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -172,8 +172,8 @@ bool Notebook::save(int page, bool reparse_needed) { } auto view=get_view(page); if (view->file_path != "" && view->get_buffer()->get_modified()) { - //strip trailing whitespaces and add trailing newline if missing - if(Singleton::config->source.strip_trailing_whitespaces) { + //Remove trailing whitespace characters on save, and add trailing newline if missing + if(Singleton::config->source.cleanup_whitespace_characters) { auto buffer=view->get_buffer(); buffer->begin_user_action(); for(int line=0;lineget_line_count();line++) {