From 9b0e4555ab16a9197185d2d1c3a6374afba5da3b Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 7 Jan 2025 09:41:52 +0100 Subject: [PATCH 01/10] Updated libclangmm --- lib/libclangmm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libclangmm b/lib/libclangmm index fb6e819..88e64eb 160000 --- a/lib/libclangmm +++ b/lib/libclangmm @@ -1 +1 @@ -Subproject commit fb6e8190fdf2c8b209e01607ab474518eb8f5b47 +Subproject commit 88e64eb5bcc904604812dc9f380e001fd2a54aad From d473c95af0387d0ce630c615ca6ac70667677d5e Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 7 Jan 2025 12:02:45 +0100 Subject: [PATCH 02/10] Fixed fontconfig cmake search and libclang isysroot issue on MacOS --- CMakeLists.txt | 2 +- src/compile_commands.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2cd5d5..0da7059 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ if(APPLE) include_directories(/usr/local/opt/gettext/include) set(CMAKE_MACOSX_RPATH 1) - set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libsigc++@2/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig") + set(ENV{PKG_CONFIG_PATH} "/opt/homebrew/opt/fontconfig/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libsigc++@2/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig") endif() if(${CMAKE_SYSTEM_NAME} MATCHES FreeBSD) link_directories(/usr/local/lib) diff --git a/src/compile_commands.cpp b/src/compile_commands.cpp index 3fb4fd9..ace761a 100644 --- a/src/compile_commands.cpp +++ b/src/compile_commands.cpp @@ -123,6 +123,14 @@ std::vector CompileCommands::get_arguments(const boost::filesystem: arguments.emplace_back(resource_path); } +#ifdef __APPLE__ + // Add -isysroot argument if it is missing on MacOS, which is needed by newer libclang + if(std::none_of(arguments.begin(), arguments.end(), [](const std::string &argument) { return argument == "-isysroot"; })) { + arguments.emplace_back("-isysroot"); + arguments.emplace_back("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"); + } +#endif + // Do not add -fretain-comments-from-system-headers if pch is used, since the pch was most likely made without this flag if(std::none_of(arguments.begin(), arguments.end(), [](const std::string &argument) { return argument == "-include-pch"; })) arguments.emplace_back("-fretain-comments-from-system-headers"); From 332bf8b627399482c8ea38ab0563a347a6de7713 Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 7 Jan 2025 12:11:21 +0100 Subject: [PATCH 03/10] Updated cmake_minimum_required --- CMakeLists.txt | 2 +- lib/libclangmm | 2 +- lib/tiny-process-library | 2 +- src/window.cpp | 4 ++-- tests/lldb_test_files/CMakeLists.txt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0da7059..ce38b29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) project(juci) set(JUCI_VERSION "1.8.0.2") diff --git a/lib/libclangmm b/lib/libclangmm index 88e64eb..8dca5d8 160000 --- a/lib/libclangmm +++ b/lib/libclangmm @@ -1 +1 @@ -Subproject commit 88e64eb5bcc904604812dc9f380e001fd2a54aad +Subproject commit 8dca5d81af05d5184da92a2ca2ce175b5577de25 diff --git a/lib/tiny-process-library b/lib/tiny-process-library index 6166ba5..8bbb5a2 160000 --- a/lib/tiny-process-library +++ b/lib/tiny-process-library @@ -1 +1 @@ -Subproject commit 6166ba5dce461438cefb57e847832aca25d510d7 +Subproject commit 8bbb5a211c5c9df8ee69301da9d22fb977b27dc1 diff --git a/src/window.cpp b/src/window.cpp index c443709..ca67770 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -356,7 +356,7 @@ void Window::set_menu_actions() { // Depending on default_build_management_system, generate build configuration if(Config::get().project.default_build_management_system == "cmake") { build_config_path = project_path / "CMakeLists.txt"; - build_config = "cmake_minimum_required(VERSION 3.5)\n\nproject(" + project_name + ")\n\nset(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -std=c11 -Wall -Wextra\")\n\nadd_executable(" + project_name + " main.c)\n"; + build_config = "cmake_minimum_required(VERSION 3.10)\n\nproject(" + project_name + ")\n\nset(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -std=c11 -Wall -Wextra\")\n\nadd_executable(" + project_name + " main.c)\n"; } else if(Config::get().project.default_build_management_system == "meson") { build_config_path = project_path / "meson.build"; @@ -413,7 +413,7 @@ void Window::set_menu_actions() { // Depending on default_build_management_system, generate build configuration if(Config::get().project.default_build_management_system == "cmake") { build_config_path = project_path / "CMakeLists.txt"; - build_config = "cmake_minimum_required(VERSION 3.5)\n\nproject(" + project_name + ")\n\nset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++1y -Wall -Wextra\")\n\nadd_executable(" + project_name + " main.cpp)\n"; + build_config = "cmake_minimum_required(VERSION 3.10)\n\nproject(" + project_name + ")\n\nset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++1y -Wall -Wextra\")\n\nadd_executable(" + project_name + " main.cpp)\n"; } else if(Config::get().project.default_build_management_system == "meson") { build_config_path = project_path / "meson.build"; diff --git a/tests/lldb_test_files/CMakeLists.txt b/tests/lldb_test_files/CMakeLists.txt index 36a1230..69ac7d3 100644 --- a/tests/lldb_test_files/CMakeLists.txt +++ b/tests/lldb_test_files/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) add_compile_options(-O0 -g -Wno-unused-but-set-variable) From 0984889b984c725a32b9f1eb2d1ae5cc861ff492 Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 7 Jan 2025 12:19:31 +0100 Subject: [PATCH 04/10] Fixed boost cmake warning --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce38b29..5a9bd36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,10 @@ option(LIBCLANG_PATH "Use custom path for libclang") option(LIBLLDB_PATH "Use custom path for liblldb") option(FLATPAK_SANDBOX "Runs from within a flatpak sandbox") +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) +endif() + find_package(Boost 1.54 COMPONENTS REQUIRED filesystem serialization) find_package(ASPELL REQUIRED) include(FindPkgConfig) From 1944bf78bbf13b9bd80be7df303aac1ea16047a9 Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 7 Jan 2025 18:29:39 +0100 Subject: [PATCH 05/10] v1.8.1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a9bd36..7b99dde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.10) project(juci) -set(JUCI_VERSION "1.8.0.2") +set(JUCI_VERSION "1.8.1") set(CPACK_PACKAGE_NAME "jucipp") set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim ") From bd2cb0a288b75be82c0c0abfe172de5b01ef3e5e Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 3 Feb 2025 09:11:59 +0100 Subject: [PATCH 06/10] Escape key now closes tooltips --- src/window.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index ca67770..3507e3d 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2011,8 +2011,11 @@ bool Window::on_key_press_event(GdkEventKey *event) { } } - if(event->keyval == GDK_KEY_Escape) + if(event->keyval == GDK_KEY_Escape) { EntryBox::get().hide(); + if(auto view = Notebook::get().get_current_view()) + view->hide_tooltips(); + } #ifdef __APPLE__ // For Apple's Command-left, right, up, down keys else if((event->state & GDK_META_MASK) > 0 && (event->state & GDK_MOD1_MASK) == 0) { if(event->keyval == GDK_KEY_Left || event->keyval == GDK_KEY_KP_Left) { From e21a641d26de9562d9e012b59365142c586ae7e2 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 24 Feb 2025 09:20:08 +0100 Subject: [PATCH 07/10] Fixed build issue on MacOS --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b99dde..56ae6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ if(APPLE) include_directories(/usr/local/opt/gettext/include) set(CMAKE_MACOSX_RPATH 1) - set(ENV{PKG_CONFIG_PATH} "/opt/homebrew/opt/fontconfig/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libsigc++@2/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig") + set(ENV{PKG_CONFIG_PATH} "/opt/homebrew/opt/cairo/lib/pkgconfig:/opt/homebrew/opt/fontconfig/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libsigc++@2/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig") endif() if(${CMAKE_SYSTEM_NAME} MATCHES FreeBSD) link_directories(/usr/local/lib) From eb9fc4d9e6b998dc320aa7afb8ba0d1b73764718 Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 4 Mar 2025 18:42:18 +0100 Subject: [PATCH 08/10] Fixed isysroot settings on MacOS --- src/compile_commands.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/compile_commands.cpp b/src/compile_commands.cpp index ace761a..94a91e7 100644 --- a/src/compile_commands.cpp +++ b/src/compile_commands.cpp @@ -126,8 +126,16 @@ std::vector CompileCommands::get_arguments(const boost::filesystem: #ifdef __APPLE__ // Add -isysroot argument if it is missing on MacOS, which is needed by newer libclang if(std::none_of(arguments.begin(), arguments.end(), [](const std::string &argument) { return argument == "-isysroot"; })) { - arguments.emplace_back("-isysroot"); - arguments.emplace_back("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"); + auto sysroots = {"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"}; + boost::system::error_code ec; + for(auto &sysroot : sysroots) { + if(boost::filesystem::exists(sysroot, ec)) { + arguments.emplace_back("-isysroot"); + arguments.emplace_back(sysroot); + break; + } + } } #endif From 1f94ae9a800c76d23852d5466bed093988a14fd9 Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 11 Mar 2025 19:21:38 +0100 Subject: [PATCH 09/10] Added comment char for prolog --- src/source.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/source.cpp b/src/source.cpp index de31d72..f068f01 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -223,7 +223,7 @@ Source::View::View(const boost::filesystem::path &file_path, const Glib::RefPtr< else { if(is_language({"cmake", "makefile", "python", "python3", "sh", "perl", "ruby", "r", "asm", "automake", "yaml", "docker", "julia"})) comment_characters = "#"; - else if(is_language({"latex", "matlab", "octave", "bibtex"})) + else if(is_language({"latex", "matlab", "octave", "bibtex", "prolog"})) comment_characters = "%"; else if(language_id == "fortran") comment_characters = "!"; From 14b3317eee66c3d8ad7c93e599df7851f4182279 Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 3 Apr 2025 09:21:44 +0200 Subject: [PATCH 10/10] Select all now works in terminal as well --- src/source_base.cpp | 13 ++++++------- src/source_base.hpp | 6 +++--- src/terminal.cpp | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/source_base.cpp b/src/source_base.cpp index 40c1723..73bac7e 100644 --- a/src/source_base.cpp +++ b/src/source_base.cpp @@ -10,6 +10,12 @@ #include #include +#ifdef __APPLE__ +GdkModifierType Source::CommonView::primary_modifier_mask = GDK_MOD2_MASK; +#else +GdkModifierType Source::CommonView::primary_modifier_mask = GDK_CONTROL_MASK; +#endif + Source::CommonView::CommonView(const Glib::RefPtr &language) : Gsv::View() { set_tab_width(4); // Visual size of a \t hardcoded to be equal to visual size of 4 spaces @@ -369,13 +375,6 @@ Source::BaseView::BaseView(const boost::filesystem::path &file_path, const Glib: } set_tab_char_and_size(tab_char, tab_size); -#ifdef __APPLE__ - primary_modifier_mask = GDK_MOD2_MASK; -#else - primary_modifier_mask = GDK_CONTROL_MASK; -#endif - - set_snippets(); snippet_parameter_tag = get_buffer()->create_tag(); diff --git a/src/source_base.hpp b/src/source_base.hpp index f6a160a..3a0a0a7 100644 --- a/src/source_base.hpp +++ b/src/source_base.hpp @@ -50,6 +50,9 @@ namespace Source { bool keep_clipboard = false; + /// Apple key for MacOS, and control key otherwise + static GdkModifierType primary_modifier_mask; + bool on_key_press_event(GdkEventKey *event) override; bool on_motion_notify_event(GdkEventMotion *motion_event) override; @@ -146,9 +149,6 @@ namespace Source { std::string tab; std::pair find_tab_char_and_size(); - /// Apple key for MacOS, and control key otherwise - GdkModifierType primary_modifier_mask; - /// Move iter to line start. Depending on iter position, before or after indentation. /// Works with wrapped lines. Gtk::TextIter get_smart_home_iter(const Gtk::TextIter &iter); diff --git a/src/terminal.cpp b/src/terminal.cpp index 3e3390d..e17e30f 100644 --- a/src/terminal.cpp +++ b/src/terminal.cpp @@ -624,7 +624,8 @@ bool Terminal::on_key_press_event(GdkEventKey *event) { if(event->keyval == GDK_KEY_Home || event->keyval == GDK_KEY_End || event->keyval == GDK_KEY_Page_Up || event->keyval == GDK_KEY_Page_Down || event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down || - event->keyval == GDK_KEY_Left || event->keyval == GDK_KEY_Right) + event->keyval == GDK_KEY_Left || event->keyval == GDK_KEY_Right || + ((event->state & primary_modifier_mask) && event->keyval == GDK_KEY_a)) return Source::CommonView::on_key_press_event(event); LockGuard lock(processes_mutex);