Browse Source

Merge branch 'space_between_lines_option' of https://gitlab.com/shivangsgangadia/jucipp-clangd-support

pipelines/1486128344
eidheim 1 year ago
parent
commit
27a4c47f5a
  1. 2
      src/config.cpp
  2. 1
      src/config.hpp
  3. 2
      src/source_base.cpp
  4. 5
      src/window.cpp

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

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

2
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<Gtk::TextBuffer::Mark> &mark) {
if(mark->get_name() == "insert") {
keep_clipboard = false;

5
src/window.cpp

@ -282,9 +282,12 @@ 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() {
auto &menu = Menu::get();

Loading…
Cancel
Save