Fix chktex highlighting wrong column when using tabs instead of spaces (#4661)

* 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

* Add test_tex_chktex.vader

* Use functions to set g: variables in ale_linters/tex/chktex.vim

* Update ale_linters#tex#chktex#GetCommand() to use '%e'
This commit is contained in:
Jorengarenar
2024-01-14 13:04:23 +01:00
committed by GitHub
parent 3dbf0b2202
commit 94f764631d
2 changed files with 40 additions and 15 deletions

View File

@@ -0,0 +1,27 @@
Before:
call ale#assert#SetUpLinterTest('tex', 'chktex')
After:
call ale#assert#TearDownLinterTest()
Execute(The default command should be correct):
AssertLinter 'chktex',
\ ale#Escape('chktex')
\ . ' -v0 -p stdin -q -s TabSize=1'
\ . ' -I'
Execute(The executable should be configurable):
let g:ale_tex_chktex_executable = 'bin/foo'
AssertLinter 'bin/foo',
\ ale#Escape('bin/foo')
\ . ' -v0 -p stdin -q -s TabSize=1'
\ . ' -I'
Execute(The options should be configurable):
let b:ale_tex_chktex_options = '--something'
AssertLinter 'chktex',
\ ale#Escape('chktex')
\ . ' -v0 -p stdin -q -s TabSize=1'
\ . ' --something'