mirror of
https://github.com/neovim/neovim.git
synced 2026-04-28 10:14:06 +00:00
vim-patch:9.1.0289: filetype: some TeX files are not recognized (#28291)
Problem: filetype: some TeX files are not recognized
Solution: Add more patterns for TeX files and inspect
a few more files for being TeX files
(Wu, Zhenyu)
closes: vim/vim#14456
61ee833a50
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
This commit is contained in:
@@ -252,7 +252,7 @@ local extension = {
|
||||
capnp = 'capnp',
|
||||
cdc = 'cdc',
|
||||
cdl = 'cdl',
|
||||
toc = 'cdrtoc',
|
||||
toc = detect_line1('\\contentsline', 'tex', 'cdrtoc'),
|
||||
cfc = 'cf',
|
||||
cfm = 'cf',
|
||||
cfi = 'cf',
|
||||
@@ -631,7 +631,7 @@ local extension = {
|
||||
livemd = 'livebook',
|
||||
lgt = 'logtalk',
|
||||
lotos = 'lotos',
|
||||
lot = 'lotos',
|
||||
lot = detect_line1('\\contentsline', 'tex', 'lotos'),
|
||||
lout = 'lout',
|
||||
lou = 'lout',
|
||||
ulpc = 'lpc',
|
||||
@@ -1035,6 +1035,27 @@ local extension = {
|
||||
bbl = 'tex',
|
||||
latex = 'tex',
|
||||
sty = 'tex',
|
||||
pgf = 'tex',
|
||||
nlo = 'tex',
|
||||
nls = 'tex',
|
||||
out = 'tex',
|
||||
thm = 'tex',
|
||||
eps_tex = 'tex',
|
||||
pygtex = 'tex',
|
||||
pygstyle = 'tex',
|
||||
clo = 'tex',
|
||||
aux = 'tex',
|
||||
brf = 'tex',
|
||||
ind = 'tex',
|
||||
lof = 'tex',
|
||||
loe = 'tex',
|
||||
nav = 'tex',
|
||||
vrb = 'tex',
|
||||
ins = 'tex',
|
||||
tikz = 'tex',
|
||||
bbx = 'tex',
|
||||
cbx = 'tex',
|
||||
beamer = 'tex',
|
||||
cls = detect.cls,
|
||||
texi = 'texinfo',
|
||||
txi = 'texinfo',
|
||||
@@ -2023,6 +2044,7 @@ local pattern = {
|
||||
['.*termcap.*'] = starsetf(function(path, bufnr)
|
||||
return require('vim.filetype.detect').printcap('term')
|
||||
end),
|
||||
['.*/tex/latex/.*%.cfg'] = 'tex',
|
||||
['.*%.t%.html'] = 'tilde',
|
||||
['%.?tmux.*%.conf'] = 'tmux',
|
||||
['%.?tmux.*%.conf.*'] = { 'tmux', { priority = -1 } },
|
||||
|
||||
@@ -458,6 +458,9 @@ end
|
||||
|
||||
--- @type vim.filetype.mapfn
|
||||
function M.def(_, bufnr)
|
||||
if getline(bufnr, 1):find('%%%%') then
|
||||
return 'tex'
|
||||
end
|
||||
if vim.g.filetype_def == 'modula2' or is_modula2(bufnr) then
|
||||
return modula2(bufnr)
|
||||
end
|
||||
@@ -738,7 +741,9 @@ end
|
||||
|
||||
--- @type vim.filetype.mapfn
|
||||
function M.inp(_, bufnr)
|
||||
if getline(bufnr, 1):find('^%*') then
|
||||
if getline(bufnr, 1):find('%%%%') then
|
||||
return 'tex'
|
||||
elseif getline(bufnr, 1):find('^%*') then
|
||||
return 'abaqus'
|
||||
else
|
||||
for _, line in ipairs(getlines(bufnr, 1, 500)) do
|
||||
|
||||
Reference in New Issue
Block a user