Browse Source

Added wrap_lines option to config.json. However, home and end-keys are not functioning properly, so leaving the option default false for now.

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

2
src/config.cc

@ -52,6 +52,8 @@ void MainConfig::GenerateSource() {
source_cfg->default_tab_size = source_json.get<unsigned>("default_tab_size");
source_cfg->auto_tab_char_and_size = source_json.get<bool>("auto_tab_char_and_size");
source_cfg->wrap_lines = source_json.get_value<bool>("wrap_lines");
source_cfg->highlight_current_line = source_json.get_value<bool>("highlight_current_line");
source_cfg->show_line_numbers = source_json.get_value<bool>("show_line_numbers");

1
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"

2
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)

1
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<std::string, std::string> clang_types;

Loading…
Cancel
Save