Browse Source

Renamed strip_trailing_whitespaces to cleanup_whitespace_characters

merge-requests/365/head
eidheim 10 years ago
parent
commit
39fb97d295
  1. 2
      src/config.cc
  2. 2
      src/config.h
  3. 4
      src/files.h
  4. 4
      src/notebook.cc

2
src/config.cc

@ -146,7 +146,7 @@ void Config::get_source() {
source.style=source_json.get<std::string>("style"); source.style=source_json.get<std::string>("style");
source.font=source_json.get<std::string>("font"); source.font=source_json.get<std::string>("font");
source.strip_trailing_whitespaces=source_json.get<bool>("strip_trailing_whitespaces"); source.cleanup_whitespace_characters=source_json.get<bool>("cleanup_whitespace_characters");
source.show_map = source_json.get<bool>("show_map"); source.show_map = source_json.get<bool>("show_map");
source.map_font_size = source_json.get<std::string>("map_font_size"); source.map_font_size = source_json.get<std::string>("map_font_size");

2
src/config.h

@ -49,7 +49,7 @@ public:
std::string font; std::string font;
std::string spellcheck_language; std::string spellcheck_language;
bool strip_trailing_whitespaces; bool cleanup_whitespace_characters;
bool show_map; bool show_map;
std::string map_font_size; std::string map_font_size;

4
src/files.h

@ -29,8 +29,8 @@ const std::string configjson =
" \"font\": \"Monospace\",\n" " \"font\": \"Monospace\",\n"
#endif #endif
#endif #endif
" \"strip_trailing_whitespaces_comment\": \"Remove trailing whitespace characters on save, and add trailing newline if missing\",\n" " \"cleanup_whitespace_characters_comment\": \"Remove trailing whitespace characters on save, and add trailing newline if missing\",\n"
" \"strip_trailing_whitespaces\": false,\n" " \"cleanup_whitespace_characters\": false,\n"
" \"show_map\": true,\n" " \"show_map\": true,\n"
" \"map_font_size\": \"1\",\n" " \"map_font_size\": \"1\",\n"
" \"spellcheck_language_comment\": \"Use \\\"\\\" to set language from your locale settings\",\n" " \"spellcheck_language_comment\": \"Use \\\"\\\" to set language from your locale settings\",\n"

4
src/notebook.cc

@ -172,8 +172,8 @@ bool Notebook::save(int page, bool reparse_needed) {
} }
auto view=get_view(page); auto view=get_view(page);
if (view->file_path != "" && view->get_buffer()->get_modified()) { if (view->file_path != "" && view->get_buffer()->get_modified()) {
//strip trailing whitespaces and add trailing newline if missing //Remove trailing whitespace characters on save, and add trailing newline if missing
if(Singleton::config->source.strip_trailing_whitespaces) { if(Singleton::config->source.cleanup_whitespace_characters) {
auto buffer=view->get_buffer(); auto buffer=view->get_buffer();
buffer->begin_user_action(); buffer->begin_user_action();
for(int line=0;line<buffer->get_line_count();line++) { for(int line=0;line<buffer->get_line_count();line++) {

Loading…
Cancel
Save