mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 02:34:10 +00:00
vim-patch:9.1.0442: hare runtime files outdated (#29011)
Problem: hare runtime files outdated
Solution: runtime(hare): update hare.vim to match upstream
(Amelia Clarke)
closes: vim/vim#14836
35dfe58a54
Co-authored-by: Amelia Clarke <selene@perilune.dev>
This commit is contained in:
@@ -1637,7 +1637,7 @@ local filename = {
|
||||
['.xsdbcmdhistory'] = 'tcl',
|
||||
['texmf.cnf'] = 'texmf',
|
||||
COPYING = 'text',
|
||||
README = 'text',
|
||||
README = detect_seq(detect.haredoc, 'text'),
|
||||
LICENSE = 'text',
|
||||
AUTHORS = 'text',
|
||||
tfrc = 'tf',
|
||||
|
||||
@@ -650,6 +650,30 @@ function M.header(_, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
--- Recursively search for Hare source files in a directory and any
|
||||
--- subdirectories, up to a given depth.
|
||||
--- @param dir string
|
||||
--- @param depth number
|
||||
--- @return boolean
|
||||
local function is_hare_module(dir, depth)
|
||||
depth = math.max(depth, 0)
|
||||
for name, _ in vim.fs.dir(dir, { depth = depth + 1 }) do
|
||||
if name:find('%.ha$') then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--- @type vim.filetype.mapfn
|
||||
function M.haredoc(path, _)
|
||||
if vim.g.filetype_haredoc then
|
||||
if is_hare_module(vim.fs.dirname(path), vim.g.haredoc_search_depth or 1) then
|
||||
return 'haredoc'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- @type vim.filetype.mapfn
|
||||
function M.html(_, bufnr)
|
||||
for _, line in ipairs(getlines(bufnr, 1, 10)) do
|
||||
|
||||
Reference in New Issue
Block a user