From 2c5daa85e2f26bcd1754e8135a12040c8195bbd0 Mon Sep 17 00:00:00 2001 From: eidheim Date: Wed, 6 May 2020 11:58:14 +0200 Subject: [PATCH] Fixed tests on FreeBSD --- src/source.cc | 4 ++-- src/source_generic.cc | 1 - src/source_language_protocol.cc | 1 - tests/source_clang_test.cc | 4 ++-- tests/source_generic_test.cc | 2 +- tests/source_key_test.cc | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/source.cc b/src/source.cc index a9373e4..0b57c32 100644 --- a/src/source.cc +++ b/src/source.cc @@ -389,8 +389,8 @@ void Source::View::configure() { gtk_source_view_set_background_pattern(this->gobj(), GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID); else gtk_source_view_set_background_pattern(this->gobj(), GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE); - property_show_right_margin() = Config::get().source.show_right_margin; - property_right_margin_position() = Config::get().source.right_margin_position; + if((property_show_right_margin() = Config::get().source.show_right_margin)) + property_right_margin_position() = Config::get().source.right_margin_position; //Create tags for diagnostic warnings and errors: auto scheme = get_source_buffer()->get_style_scheme(); diff --git a/src/source_generic.cc b/src/source_generic.cc index 59220cf..ebe3c6f 100644 --- a/src/source_generic.cc +++ b/src/source_generic.cc @@ -20,7 +20,6 @@ inline pid_t get_current_process_id() { #endif Source::GenericView::GenericView(const boost::filesystem::path &file_path, const Glib::RefPtr &language) : BaseView(file_path, language), View(file_path, language, true), autocomplete(this, interactive_completion, last_keyval, false) { - configure(); spellcheck_all = true; if(language) { diff --git a/src/source_language_protocol.cc b/src/source_language_protocol.cc index c364228..6a541e9 100644 --- a/src/source_language_protocol.cc +++ b/src/source_language_protocol.cc @@ -367,7 +367,6 @@ void LanguageProtocol::Client::handle_server_request(const std::string &method, Source::LanguageProtocolView::LanguageProtocolView(const boost::filesystem::path &file_path, const Glib::RefPtr &language, std::string language_id_) : Source::BaseView(file_path, language), Source::View(file_path, language), uri(filesystem::get_uri_from_path(file_path)), language_id(std::move(language_id_)), client(LanguageProtocol::Client::get(file_path, language_id)) { - configure(); get_source_buffer()->set_language(language); get_source_buffer()->set_highlight_syntax(true); diff --git a/tests/source_clang_test.cc b/tests/source_clang_test.cc index 170c4fd..3b66842 100644 --- a/tests/source_clang_test.cc +++ b/tests/source_clang_test.cc @@ -29,7 +29,7 @@ int main() { Config::get().project.default_build_path = "./build"; Source::ClangView *clang_view = new Source::ClangView(boost::filesystem::canonical(std::string(JUCI_TESTS_PATH) + "/source_clang_test_files/main.cpp"), - Gsv::LanguageManager::get_default()->get_language("cpp")); + Source::LanguageManager::get_default()->get_language("cpp")); while(!clang_view->parsed) flush_events(); g_assert_cmpuint(clang_view->clang_diagnostics.size(), ==, 0); @@ -82,7 +82,7 @@ int main() { // test remove_include_guard { - clang_view->language = Gsv::LanguageManager::get_default()->get_language("chdr"); + clang_view->language = Source::LanguageManager::get_default()->get_language("chdr"); std::string source = "#ifndef F\n#define F\n#endif // F"; clangmm::remove_include_guard(source); g_assert_cmpstr(source.c_str(), ==, " \n \n "); diff --git a/tests/source_generic_test.cc b/tests/source_generic_test.cc index 7e344a6..bddf5e6 100644 --- a/tests/source_generic_test.cc +++ b/tests/source_generic_test.cc @@ -8,7 +8,7 @@ int main() { auto tests_path = boost::filesystem::canonical(JUCI_TESTS_PATH); auto source_file = tests_path / "tmp" / "source_file.md"; - auto language_manager = Gsv::LanguageManager::get_default(); + auto language_manager = Source::LanguageManager::get_default(); auto language = language_manager->get_language("markdown"); Source::GenericView view(source_file, language); diff --git a/tests/source_key_test.cc b/tests/source_key_test.cc index e0e339e..47541e2 100644 --- a/tests/source_key_test.cc +++ b/tests/source_key_test.cc @@ -14,7 +14,7 @@ int main() { auto tests_path = boost::filesystem::canonical(JUCI_TESTS_PATH); auto source_file = tests_path / "tmp" / "source_file.cpp"; - auto language_manager = Gsv::LanguageManager::get_default(); + auto language_manager = Source::LanguageManager::get_default(); GdkEventKey event; event.state = 0;