aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/filetype.lua
diff options
context:
space:
mode:
authorJonas Strittmatter <40792180+smjonas@users.noreply.github.com>2022-05-03 20:29:04 +0200
committerGitHub <noreply@github.com>2022-05-03 12:29:04 -0600
commit8ef03188e68cc81bcb6a630a20451090c9557a98 (patch)
tree7dfa540fba8d564543d430421f37b9055132a323 /runtime/lua/vim/filetype.lua
parent192488379691a841144ac2ed42d8821d0359bf83 (diff)
downloadrneovim-8ef03188e68cc81bcb6a630a20451090c9557a98.tar.gz
rneovim-8ef03188e68cc81bcb6a630a20451090c9557a98.tar.bz2
rneovim-8ef03188e68cc81bcb6a630a20451090c9557a98.zip
refactor(runtime): convert dist#ft functions to lua (#18247)
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
Diffstat (limited to 'runtime/lua/vim/filetype.lua')
-rw-r--r--runtime/lua/vim/filetype.lua84
1 files changed, 42 insertions, 42 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 911950171f..77ebb64b1d 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -784,19 +784,19 @@ local extension = {
zsh = "zsh",
vala = "vala",
E = function() vim.fn["dist#ft#FTe"]() end,
- EU = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- EW = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- EX = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- EXU = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- EXW = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
+ EU = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
+ EW = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
+ EX = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
+ EXU = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
+ EXW = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
PL = function() vim.fn["dist#ft#FTpl"]() end,
- R = function() vim.fn["dist#ft#FTr"]() end,
+ R = function(path, bufnr) require("vim.filetype.detect").r(bufnr) end,
asm = function() vim.fn["dist#ft#FTasm"]() end,
bas = function() vim.fn["dist#ft#FTbas"]() end,
bi = function() vim.fn["dist#ft#FTbas"]() end,
bm = function() vim.fn["dist#ft#FTbas"]() end,
bash = function() vim.fn["dist#ft#SetFileTypeSH"]("bash") end,
- btm = function() vim.fn["dist#ft#FTbtm"]() end,
+ btm = function(path, bufnr) return require("vim.filetype.detect").btm(bufnr) end,
c = function() vim.fn["dist#ft#FTlpc"]() end,
ch = function() vim.fn["dist#ft#FTchange"]() end,
com = function() vim.fn["dist#ft#BindzoneCheck"]('dcl') end,
@@ -808,29 +808,29 @@ local extension = {
e = function() vim.fn["dist#ft#FTe"]() end,
ebuild = function() vim.fn["dist#ft#SetFileTypeSH"]("bash") end,
eclass = function() vim.fn["dist#ft#SetFileTypeSH"]("bash") end,
- ent = function() vim.fn["dist#ft#FTent"]() end,
+ ent = function(path, bufnr) return require("vim.filetype.detect").ent(bufnr) end,
env = function() vim.fn["dist#ft#SetFileTypeSH"](vim.fn.getline(1)) end,
- eu = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- ew = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- ex = function() vim.fn["dist#ft#ExCheck"]() end,
- exu = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- exw = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- frm = function() vim.fn["dist#ft#FTfrm"]() end,
+ eu = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
+ ew = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
+ ex = function(path, bufnr) return require("vim.filetype.detect").ex(bufnr) end,
+ exu = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
+ exw = function(path, bufnr) return require("vim.filetype.detect").euphoria(bufnr) end,
+ frm = function(path, bufnr) require("vim.filetype.detect").frm(bufnr) end,
fs = function() vim.fn["dist#ft#FTfs"]() end,
- h = function() vim.fn["dist#ft#FTheader"]() end,
+ h = function(path, bufnr) require("vim.filetype.detect").header(bufnr) end,
htm = function() vim.fn["dist#ft#FThtml"]() end,
html = function() vim.fn["dist#ft#FThtml"]() end,
i = function() vim.fn["dist#ft#FTprogress_asm"]() end,
- idl = function() vim.fn["dist#ft#FTidl"]() end,
+ idl = function(path, bufnr) require("vim.filetype.detect").idl(bufnr) end,
inc = function() vim.fn["dist#ft#FTinc"]() end,
- inp = function() vim.fn["dist#ft#Check_inp"]() end,
+ inp = function(path, bufnr) require("vim.filetype.detect").inp(bufnr) end,
ksh = function() vim.fn["dist#ft#SetFileTypeSH"]("ksh") end,
lst = function() vim.fn["dist#ft#FTasm"]() end,
m = function() vim.fn["dist#ft#FTm"]() end,
mac = function() vim.fn["dist#ft#FTasm"]() end,
- mc = function() vim.fn["dist#ft#McSetf"]() end,
+ mc = function(path, bufnr) require("vim.filetype.detect").mc(bufnr) end,
mm = function() vim.fn["dist#ft#FTmm"]() end,
- mms = function() vim.fn["dist#ft#FTmms"]() end,
+ mms = function(path, bufnr) require("vim.filetype.detect").mms(bufnr) end,
p = function() vim.fn["dist#ft#FTprogress_pascal"]() end,
patch = function(path, bufnr)
local firstline = getline(bufnr, 1)
@@ -844,22 +844,22 @@ local extension = {
pp = function() vim.fn["dist#ft#FTpp"]() end,
pro = function() vim.fn["dist#ft#ProtoCheck"]('idlang') end,
pt = function() vim.fn["dist#ft#FThtml"]() end,
- r = function() vim.fn["dist#ft#FTr"]() end,
- rdf = function() vim.fn["dist#ft#Redif"]() end,
+ r = function(path, bufnr) require("vim.filetype.detect").r(bufnr) end,
+ rdf = function(path, bufnr) require("vim.filetype.detect").redif(bufnr) end,
rules = function() vim.fn["dist#ft#FTRules"]() end,
- sc = function() vim.fn["dist#ft#FTsc"]() end,
- scd = function() vim.fn["dist#ft#FTscd"]() end,
+ sc = function(path, bufnr) require("vim.filetype.detect").sc(bufnr) end,
+ scd = function(path, bufnr) require("vim.filetype.detect").scd(bufnr) end,
sh = function() vim.fn["dist#ft#SetFileTypeSH"](vim.fn.getline(1)) end,
shtml = function() vim.fn["dist#ft#FThtml"]() end,
- sql = function() vim.fn["dist#ft#SQL"]() end,
+ sql = function(path, bufnr) require("vim.filetype.detect").sql(bufnr) end,
stm = function() vim.fn["dist#ft#FThtml"]() end,
tcsh = function() vim.fn["dist#ft#SetFileTypeShell"]("tcsh") end,
tex = function() vim.fn["dist#ft#FTtex"]() end,
- tf = function() vim.fn["dist#ft#FTtf"]() end,
- w = function() vim.fn["dist#ft#FTprogress_cweb"]() end,
- xml = function() vim.fn["dist#ft#FTxml"]() end,
- y = function() vim.fn["dist#ft#FTy"]() end,
- zsql = function() vim.fn["dist#ft#SQL"]() end,
+ tf = function(path, bufnr) require("vim.filetype.detect").tf(bufnr) end,
+ w = function(path, bufnr) require("vim.filetype.detect").progress_cweb(bufnr) end,
+ xml = function(path, bufnr) require("vim.filetype.detect").xml(bufnr) end,
+ y = function(path, bufnr) require("vim.filetype.detect").y(bufnr) end,
+ zsql = function(path, bufnr) require("vim.filetype.detect").sql(bufnr) end,
txt = function(path, bufnr)
--helpfiles match *.txt, but should have a modeline as last line
if not getline(bufnr, -1):match("vim:.*ft=help") then
@@ -933,10 +933,10 @@ local filename = {
["exim.conf"] = "exim",
exports = "exports",
[".fetchmailrc"] = "fetchmail",
- fvSchemes = function() vim.fn["dist#ft#FTfoam"]() end,
- fvSolution = function() vim.fn["dist#ft#FTfoam"]() end,
- fvConstraints = function() vim.fn["dist#ft#FTfoam"]() end,
- fvModels = function() vim.fn["dist#ft#FTfoam"]() end,
+ fvSchemes = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ fvSolution = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ fvConstraints = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ fvModels = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
fstab = "fstab",
mtab = "fstab",
[".gdbinit"] = "gdb",
@@ -1355,7 +1355,7 @@ local pattern = {
["%.zcompdump.*"] = starsetf('zsh'),
["%.zlog.*"] = starsetf('zsh'),
["%.zsh.*"] = starsetf('zsh'),
- [".*%.[1-9]"] = function() vim.fn["dist#ft#FTnroff"]() end,
+ [".*%.[1-9]"] = function(path, bufnr) return require("vim.filetype.detect").nroff(bufnr) end,
[".*%.[aA]"] = function() vim.fn["dist#ft#FTasm"]() end,
[".*%.[sS]"] = function() vim.fn["dist#ft#FTasm"]() end,
[".*%.properties_.._.._.*"] = starsetf('jproperties'),
@@ -1434,14 +1434,14 @@ local pattern = {
["mutt" .. string.rep("[%w_-]", 6)] = "mail",
["neomutt" .. string.rep("[%w_-]", 6)] = "mail",
["/tmp/SLRN[0-9A-Z.]+"] = "mail",
- ["[a-zA-Z0-9].*Dict"] = function() vim.fn["dist#ft#FTfoam"]() end,
- ["[a-zA-Z0-9].*Dict%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
- ["[a-zA-Z].*Properties"] = function() vim.fn["dist#ft#FTfoam"]() end,
- ["[a-zA-Z].*Properties%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
- [".*Transport%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
- [".*/constant/g"] = function() vim.fn["dist#ft#FTfoam"]() end,
- [".*/0/.*"] = function() vim.fn["dist#ft#FTfoam"]() end,
- [".*/0%.orig/.*"] = function() vim.fn["dist#ft#FTfoam"]() end,
+ ["[a-zA-Z0-9].*Dict"] = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ ["[a-zA-Z0-9].*Dict%..*"] = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ ["[a-zA-Z].*Properties"] = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ ["[a-zA-Z].*Properties%..*"] = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ [".*Transport%..*"] = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ [".*/constant/g"] = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ [".*/0/.*"] = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
+ [".*/0%.orig/.*"] = function(path, bufnr) require("vim.filetype.detect").foam(bufnr) end,
[".*/etc/sensors%.d/[^.].*"] = starsetf('sensors'),
[".*%.git/.*"] = function(path, bufnr)
local firstline = getline(bufnr, 1)