diff --git a/src/config.cc b/src/config.cc index 7d6da88..1ed39c7 100644 --- a/src/config.cc +++ b/src/config.cc @@ -51,6 +51,8 @@ void MainConfig::GenerateSource() { source_cfg->default_tab_char = source_json.get("default_tab_char"); source_cfg->default_tab_size = source_json.get("default_tab_size"); source_cfg->auto_tab_char_and_size = source_json.get("auto_tab_char_and_size"); + + source_cfg->wrap_lines = source_json.get_value("wrap_lines"); source_cfg->highlight_current_line = source_json.get_value("highlight_current_line"); source_cfg->show_line_numbers = source_json.get_value("show_line_numbers"); diff --git a/src/files.h b/src/files.h index 3db5275..44995f6 100644 --- a/src/files.h +++ b/src/files.h @@ -36,6 +36,7 @@ const std::string configjson = " \"auto_tab_char_and_size\": true, //Use false to always use default tab char and size\n" " \"default_tab_char\": \" \", //Use \"\\t\" for regular tab\n" " \"default_tab_size\": 2,\n" +" \"wrap_lines\": false,\n" " \"highlight_current_line\": true,\n" " \"show_line_numbers\": true\n" " },\n" diff --git a/src/source.cc b/src/source.cc index a9885d7..c4f43d4 100644 --- a/src/source.cc +++ b/src/source.cc @@ -72,6 +72,8 @@ Source::View::View(const boost::filesystem::path &file_path): file_path(file_pat Singleton::terminal()->print("Error: Could not find gtksourceview style: "+Singleton::Config::source()->style+'\n'); } + if(Singleton::Config::source()->wrap_lines) + set_wrap_mode(Gtk::WrapMode::WRAP_CHAR); property_highlight_current_line() = Singleton::Config::source()->highlight_current_line; property_show_line_numbers() = Singleton::Config::source()->show_line_numbers; if(Singleton::Config::source()->font.size()>0) diff --git a/src/source.h b/src/source.h index 025b06d..95fa854 100644 --- a/src/source.h +++ b/src/source.h @@ -28,6 +28,7 @@ namespace Source { bool auto_tab_char_and_size; char default_tab_char; unsigned default_tab_size; + bool wrap_lines; bool highlight_current_line; bool show_line_numbers; std::unordered_map clang_types;