diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-02-06 12:09:16 +0100 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2022-02-06 12:10:09 +0100 |
commit | 05f38bbede99ea0223550554bcfb9ab43d036d1f (patch) | |
tree | 25d4a39a25aa0bc38efec9b65579e2562f3b1990 /runtime | |
parent | 8215c05945054755b2c3cadae198894372dbfe0f (diff) | |
download | rneovim-05f38bbede99ea0223550554bcfb9ab43d036d1f.tar.gz rneovim-05f38bbede99ea0223550554bcfb9ab43d036d1f.tar.bz2 rneovim-05f38bbede99ea0223550554bcfb9ab43d036d1f.zip |
vim-patch:8.2.4305: tex filetype detection fails
Problem: Tex filetype detection fails.
Solution: Check value to be positive. (closes vim/vim#9704)
https://github.com/vim/vim/commit/e5b7897585eccec84431d8b23df5cde2e283828c
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/dist/ft.vim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 5d8734a625..aacecc521e 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -726,7 +726,7 @@ func dist#ft#FTperl() endif let save_cursor = getpos('.') call cursor(1,1) - let has_use = search('^use\s\s*\k', 'c', 30) + let has_use = search('^use\s\s*\k', 'c', 30) > 0 call setpos('.', save_cursor) if has_use setf perl @@ -758,7 +758,8 @@ func dist#ft#FTtex() let save_cursor = getpos('.') call cursor(1,1) let firstNC = search('^\s*[^[:space:]%]', 'c', 1000) - if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword. + if firstNC > 0 + " Check the next thousand lines for a LaTeX or ConTeXt keyword. let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)', |