diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2024-11-25 19:15:05 +0000 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2024-11-25 19:27:38 +0000 |
| commit | c5d770d311841ea5230426cc4c868e8db27300a8 (patch) | |
| tree | dd21f70127b4b8b5f109baefc8ecc5016f507c91 /runtime/lua/vim/filetype | |
| parent | 9be89f131f87608f224f0ee06d199fcd09d32176 (diff) | |
| parent | 081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff) | |
| download | rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2 rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip | |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'runtime/lua/vim/filetype')
| -rw-r--r-- | runtime/lua/vim/filetype/detect.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index 1cc81b177f..98b001bd51 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -869,6 +869,16 @@ function M.log(path, _) end --- @type vim.filetype.mapfn +function M.ll(_, bufnr) + local first_line = getline(bufnr, 1) + if matchregex(first_line, [[;\|\<source_filename\>\|\<target\>]]) then + return 'llvm' + else + return 'lifelines' + end +end + +--- @type vim.filetype.mapfn function M.lpc(_, bufnr) if vim.g.lpc_syntax_for_c then for _, line in ipairs(getlines(bufnr, 1, 12)) do @@ -1908,7 +1918,7 @@ local function match_from_hashbang(contents, path, dispatch_extension) end for k, v in pairs(patterns_hashbang) do - local ft = type(v) == 'table' and v[1] or v + local ft = type(v) == 'table' and v[1] or v --[[@as string]] local opts = type(v) == 'table' and v[2] or {} if opts.vim_regex and matchregex(name, k) or name:find(k) then return ft @@ -2080,6 +2090,7 @@ local function match_from_text(contents, path) return ft end else + --- @cast k string local opts = type(v) == 'table' and v[2] or {} if opts.start_lnum and opts.end_lnum then assert( |