summaryrefslogtreecommitdiff
path: root/ale_linters/tex
diff options
context:
space:
mode:
authorourigen <79729735+ourigen@users.noreply.github.com>2021-03-12 11:40:40 +0000
committerGitHub <noreply@github.com>2021-03-12 20:40:40 +0900
commit80a48d01be663205b92902ca3fa137706e3e88c6 (patch)
tree7dade66643a9304c6c80890fdbc365834a585545 /ale_linters/tex
parentc21d6afd2fb799013e3894d393bf976d9da31e65 (diff)
downloadale-80a48d01be663205b92902ca3fa137706e3e88c6.zip
Fix texlab#GetProjectRoot (#3610)
* Fix texlab GetProjectRoot * Fix indents in texlab#GetProjectRoot * Prevent texlab from starting on every tex file * Update texlab Vader tests * Fix GetProjectRoot to return parent of .git Previously, the function returned `../.git/`. We want the function to return the parent directory above that as the project root. This should help pass Vader tests.
Diffstat (limited to 'ale_linters/tex')
-rw-r--r--ale_linters/tex/texlab.vim5
1 files changed, 4 insertions, 1 deletions
diff --git a/ale_linters/tex/texlab.vim b/ale_linters/tex/texlab.vim
index 5ead74b4..dd26fa0a 100644
--- a/ale_linters/tex/texlab.vim
+++ b/ale_linters/tex/texlab.vim
@@ -1,11 +1,14 @@
" Author: Ricardo Liang <ricardoliang@gmail.com>
+" Author: ourigen <ourigen [at] pm.me>
" Description: Texlab language server (Rust rewrite)
call ale#Set('tex_texlab_executable', 'texlab')
call ale#Set('tex_texlab_options', '')
function! ale_linters#tex#texlab#GetProjectRoot(buffer) abort
- return ''
+ let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
+
+ return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
function! ale_linters#tex#texlab#GetCommand(buffer) abort