aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-02-06 15:33:39 +0100
committerGitHub <noreply@github.com>2022-02-06 15:33:39 +0100
commit51444bef24cd15cd4d6e0a81047164d137ab678b (patch)
treecce603d6619008ec4bd31cdee67daea23b7850c6 /runtime
parent4903949033dd17d3fa8e8f10542d82a6c944bf76 (diff)
parent06d2d271d780da1ad009654a2603eba534a5e280 (diff)
downloadrneovim-51444bef24cd15cd4d6e0a81047164d137ab678b.tar.gz
rneovim-51444bef24cd15cd4d6e0a81047164d137ab678b.tar.bz2
rneovim-51444bef24cd15cd4d6e0a81047164d137ab678b.zip
Merge pull request #17306 from clason/vim-8.2.4305
* Vim 8.2.4305: tex filetype detection fails * Vim 8.2.4306: no test for fixed perl filetype check
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/dist/ft.vim5
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 . '\)',