diff --git a/src/config.cpp b/src/config.cpp index e002d33..4484be9 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -134,6 +134,7 @@ void Config::read(const JSON &cfg) { source.smart_brackets = true; source.show_map = source_json.boolean("show_map", JSON::ParseOptions::accept_string); source.map_font_size = source_json.integer("map_font_size", JSON::ParseOptions::accept_string); + source.space_between_lines = source_json.integer("space_between_lines", JSON::ParseOptions::accept_string); source.show_git_diff = source_json.boolean("show_git_diff", JSON::ParseOptions::accept_string); source.show_background_pattern = source_json.boolean("show_background_pattern", JSON::ParseOptions::accept_string); source.show_right_margin = source_json.boolean("show_right_margin", JSON::ParseOptions::accept_string); @@ -279,6 +280,7 @@ std::string Config::default_config() { "smart_inserts": true, "show_map": true, "map_font_size": 1, + "space_between_lines": 1, "show_git_diff": true, "show_background_pattern": true, "show_right_margin": false, diff --git a/src/config.hpp b/src/config.hpp index 73389f6..22e0115 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -80,6 +80,7 @@ public: bool smart_inserts; bool show_map; + float space_between_lines; unsigned map_font_size; bool show_git_diff; bool show_background_pattern; diff --git a/src/source_base.cpp b/src/source_base.cpp index 0c152d4..00fb8be 100644 --- a/src/source_base.cpp +++ b/src/source_base.cpp @@ -383,6 +383,8 @@ Source::BaseView::BaseView(const boost::filesystem::path &file_path, const Glib: extra_cursor_selection = get_buffer()->create_tag(); + this->set_pixels_below_lines(Config::get().source.space_between_lines); + get_buffer()->signal_mark_set().connect([this](const Gtk::TextIter &iter, const Glib::RefPtr &mark) { if(mark->get_name() == "insert") { keep_clipboard = false; diff --git a/src/window.cpp b/src/window.cpp index c443709..3ab2d8d 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -282,8 +282,11 @@ void Window::configure() { Menu::get().set_keys(); Terminal::get().configure(); Directories::get().update(); - if(auto view = Notebook::get().get_current_view()) + if(auto view = Notebook::get().get_current_view()) { + // Special call since this property is not part of CSS + view->set_pixels_below_lines(Config::get().source.space_between_lines); Notebook::get().update_status(view); + } } void Window::set_menu_actions() {