From 271b1d4f2ff85668be6e1228b3a3fc957a740adf Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 17 Sep 2019 21:50:21 +1000 Subject: [PATCH] Add a clang_directory option to set PWD when completing This matches the directory entry in compilation databases format. --- rc/tools/clang.kak | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rc/tools/clang.kak b/rc/tools/clang.kak index 2cd6ebe2..4375eb50 100644 --- a/rc/tools/clang.kak +++ b/rc/tools/clang.kak @@ -7,6 +7,9 @@ provide-module clang %[ declare-option -docstring "options to pass to the `clang` shell command" \ str clang_options +declare-option -docstring "directory from which to invoke clang" \ + str clang_directory + declare-option -hidden str clang_tmp_dir declare-option -hidden completions clang_completions declare-option -hidden line-specs clang_flags @@ -37,6 +40,9 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are # position and a buffer timestamp, only valid completions should be # displayed. (( + if [ -n "$kak_opt_clang_directory" ]; then + cd "$kak_opt_clang_directory" + fi case ${kak_opt_filetype} in c) ft=c ;; cpp) ft=c++ ;;