From 69cec55f5a50f897b6686afe5fc7ed45bfb67d84 Mon Sep 17 00:00:00 2001 From: Shivang Gangadia Date: Tue, 24 Sep 2024 21:23:30 +0100 Subject: [PATCH] Added option to configure spacing between lines in editor --- src/notebook.cpp | 14 +------------- src/source_base.hpp | 4 ---- src/source_clang.hpp | 3 --- src/window.cpp | 5 ++--- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/notebook.cpp b/src/notebook.cpp index 4389782..fdd04d4 100644 --- a/src/notebook.cpp +++ b/src/notebook.cpp @@ -307,14 +307,6 @@ bool Notebook::open(const boost::filesystem::path &file_path_, Position position Terminal::get().print("For installation instructions please visit: https://gitlab.com/cppit/jucipp/-/blob/master/docs/language_servers.md#julia.\n"); shown.emplace(language_id); } -<<<<<<< HEAD -======= - else if(Source::IsClangType(language_id)) { - Terminal::get().print("\e[33mWarning\e[m: could not find ClangD language server for C/C++.\n"); - Terminal::get().print("For installation instructions please visit: https://gitlab.com/cppit/jucipp/-/blob/master/docs/language_servers.md#julia.\n"); - shown.emplace(language_id); - } ->>>>>>> e7c897b (Added support for configuration of space between lines in editor. Updated IsClangType to use a set.) } } source_views.emplace_back(new Source::GenericView(file_path, language)); @@ -549,11 +541,7 @@ bool Notebook::open(const boost::filesystem::path &file_path_, Position position }); #ifdef JUCI_ENABLE_DEBUG -<<<<<<< HEAD if(dynamic_cast(view) || view->language_id == "rust") { -======= - if(Source::IsClangType(view->language_id) || view->language_id == "rust") { ->>>>>>> e7c897b (Added support for configuration of space between lines in editor. Updated IsClangType to use a set.) view->toggle_breakpoint = [view](int line_nr) { if(view->get_source_buffer()->get_source_marks_at_line(line_nr, "debug_breakpoint").size() > 0) { auto start_iter = view->get_buffer()->get_iter_at_line(line_nr); @@ -870,7 +858,7 @@ void Notebook::update_status(Source::BaseView *view) { if(view->update_status_diagnostics) view->update_status_diagnostics(view); if(view->update_status_state) - view->update_status_state(view); + view->update_status_state(view); } void Notebook::clear_status() { diff --git a/src/source_base.hpp b/src/source_base.hpp index 1bd813c..f6a160a 100644 --- a/src/source_base.hpp +++ b/src/source_base.hpp @@ -8,13 +8,9 @@ #include #include #include -#include #include - namespace Source { - const std::set ClangTypeLanguages{"chdr", "cpphdr", "c", "cpp", "objc", "h", "hpp", "cc", "ino"}; - inline bool IsClangType(std::string language_id) {return ClangTypeLanguages.contains(language_id);} /// RAII-style text mark. Use instead of Gtk::TextBuffer::create_mark and Gtk::TextBuffer::delete_mark, /// since Gtk::TextBuffer::delete_mark is not called upon Glib::RefPtr deletion class Mark : public Glib::RefPtr { diff --git a/src/source_clang.hpp b/src/source_clang.hpp index fcb7c0e..78fd573 100644 --- a/src/source_clang.hpp +++ b/src/source_clang.hpp @@ -52,9 +52,6 @@ namespace Source { Glib::ustring parse_thread_buffer GUARDED_BY(parse_mutex); static const std::map &clang_types(); - /** - * @brief Adds formatting tags to tokens in the current file - */ void update_syntax() REQUIRES(parse_mutex); std::map> syntax_tags; diff --git a/src/window.cpp b/src/window.cpp index d1847ca..3ab2d8d 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -221,9 +221,7 @@ void Window::configure() { fonts_style += "* {" + font_description_string_to_style(Config::get().theme.font) + "}"; if(!Config::get().source.font.empty()) { auto font_description = Pango::FontDescription(Config::get().source.font); - fonts_style += ".juci_source_view {" - + font_description_to_style(font_description) - + "}"; + fonts_style += ".juci_source_view {" + font_description_to_style(font_description) + "}"; font_description.set_size(Config::get().source.map_font_size * 1024); fonts_style += ".juci_source_map {" + font_description_to_style(font_description) + "}"; } @@ -285,6 +283,7 @@ void Window::configure() { Terminal::get().configure(); Directories::get().update(); 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); }