diff --git a/src/config.cc b/src/config.cc index e030f32..01e81b2 100644 --- a/src/config.cc +++ b/src/config.cc @@ -71,6 +71,7 @@ void MainConfig::retrieve_config() { Singleton::Config::window()->default_size = {cfg.get("default_window_size.width"), cfg.get("default_window_size.height")}; Singleton::Config::terminal()->make_command=cfg.get("project.make_command"); Singleton::Config::terminal()->cmake_command=cfg.get("project.cmake_command"); + Singleton::Config::terminal()->clang_format_commad=cfg.get("project.clang_format_command"); Singleton::Config::terminal()->history_size=cfg.get("terminal_history_size"); } diff --git a/src/files.h b/src/files.h index eee5f0d..45f68ca 100644 --- a/src/files.h +++ b/src/files.h @@ -105,6 +105,7 @@ const std::string configjson = " \"cmake_command\": \"cmake\",\n" #endif " \"make_command\": \"make\"\n" +" \"clang_format_command\": \"clang-format\"\n" " },\n" " \"documentation_searches\": {\n" " \"clang\": {\n" diff --git a/src/source_clang.cc b/src/source_clang.cc index 533d7e7..b47a7ac 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -924,7 +924,7 @@ Source::ClangViewAutocomplete(file_path, project_path, language) { }); auto_indent=[this]() { - std::string command="clang-format"; + auto command=Singleton::Config::terminal()->clang_format_command; unsigned indent_width; std::string tab_style; if(tab_char=='\t') { diff --git a/src/terminal.h b/src/terminal.h index dcd0da9..526fa3f 100644 --- a/src/terminal.h +++ b/src/terminal.h @@ -16,6 +16,7 @@ public: public: std::string cmake_command; std::string make_command; + std::string clang_format_command; int history_size; };