Skip to content

Commit

Permalink
Fix chktex highlighting wrong column when using tabs instead of spaces
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jorenar committed Dec 16, 2023
1 parent 9a23ec1 commit a79af6f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ale_linters/tex/chktex.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a79af6f

Please sign in to comment.