From a79af6f8944dfac737cd399387c304d0ad0ef90d Mon Sep 17 00:00:00 2001 From: Jorengarenar Date: Fri, 24 Nov 2023 19:05:17 +0100 Subject: [PATCH] Fix chktex highlighting wrong column when using tabs instead of spaces Fixes #723 chktex implemented feature request [1] for allowing setting options from the command line. Thanks to that we can tell it to treat tab character as of one space width, i.e. one char. That means, after we translate the output back to Vim columns, we get correct numbers. [1]: https://savannah.nongnu.org/bugs/?56486 --- ale_linters/tex/chktex.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ale_linters/tex/chktex.vim b/ale_linters/tex/chktex.vim index 160baf0d09..e16a274752 100644 --- a/ale_linters/tex/chktex.vim +++ b/ale_linters/tex/chktex.vim @@ -16,6 +16,8 @@ function! ale_linters#tex#chktex#GetCommand(buffer) abort let l:command = ale#Var(a:buffer, 'tex_chktex_executable') " Avoid bug when used without -p (last warning has gibberish for a filename) let l:command .= ' -v0 -p stdin -q' + " Avoid bug of reporting wrong column when using tabs (issue #723) + let l:command .= ' -s TabSize=1' if !empty(l:chktex_config) let l:command .= ' -l ' . ale#Escape(l:chktex_config)