-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Textidote #3066
Conversation
This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See |
let l:exe .= ' --check ' . l:check_lang | ||
endif | ||
|
||
return l:exe . ' ' . expand('#' . a:buffer . ':t') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work when editing files in sub-foders. For example:
main.tex
chapter1/section01.tex
Removing the ':t' would properly show the textidote reported errors on both the main.tex and the chapter1/section01.tex files.
endfunction | ||
|
||
function! ale_linters#tex#textidote#Handle(buffer, lines) abort | ||
let l:pattern = '.*' . expand('#' . a:buffer . ':t:r') . '\.tex(L\(\d\+\)C\(\d\+\)-L\d\+C\d\+): \(.*\)".*"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous comment this breaks for subfolder files. Remove the :t
to make it work properly.
let l:exe = ale#Var(a:buffer, 'tex_textidote_executable') | ||
let l:exe .= ' ' . ale#Var(a:buffer, 'tex_textidote_options') | ||
|
||
let l:check_lang = ale#Var(a:buffer, 'tex_textidote_check_lang') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small attempt to get language from spelllang configuration, may be worth considering:
" Function tries to determine the language to use with textidote from the
" spelllang configuration.
function! ale_linters#tex#textidote#GetSpellLang(buffer) abort
let l:check_lang = ale#Var(a:buffer, 'tex_textidote_check_lang')
if !empty(l:check_lang)
return l:check_lang
endif
let l:supported_languages = ['en', 'de', 'es', 'fr', 'nl', 'pt']
let l:spell_languages = split(&spelllang, ',')
for spell_lang in l:spell_languages
for supported_lang in l:supported_languages
if(spell_lang == supported_lang)
return spell_lang
endif
endfor
endfor
return ''
endfunction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing tests.
This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See |
ALE migrated from Travis to Github Actions (see #3548) so it is necessary to rebase this PR from latest master branch to trigger the required checks.
|
This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See |
based on issue #2467 add support for textidote
documentation also updated