diff options
author | kylo252 <[email protected]> | 2021-11-02 17:03:21 +0100 |
---|---|---|
committer | kylo252 <[email protected]> | 2021-11-02 17:03:21 +0100 |
commit | b04bb9b79864e846af8936d6cee6ced0dd0bf93e (patch) | |
tree | 1d4d0a40330f426b51b8d62409d23869887bf7dd /lua/lvim/utils | |
parent | 17648e5a07f8c4fe851b09f3037db58c73fe292f (diff) | |
parent | 32ca5afa4ad21f1a616cc30323c272191e7548c1 (diff) |
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/utils')
-rw-r--r-- | lua/lvim/utils/ft.lua | 47 | ||||
-rw-r--r-- | lua/lvim/utils/hooks.lua | 3 |
2 files changed, 1 insertions, 49 deletions
diff --git a/lua/lvim/utils/ft.lua b/lua/lvim/utils/ft.lua deleted file mode 100644 index e9852e6f..00000000 --- a/lua/lvim/utils/ft.lua +++ /dev/null @@ -1,47 +0,0 @@ --- Here be dragons --- Opening files with telescope will not start LSP without this -local ft = {} - -ft.find_lua_ftplugins = function(filetype) - local patterns = { - string.format("ftplugin/%s.lua", filetype), - - -- Looks like we don't need this, because the first one works - -- string.format("after/ftplugin/%s.lua", filetype), - } - - local result = {} - for _, pat in ipairs(patterns) do - vim.list_extend(result, vim.api.nvim_get_runtime_file(pat, true)) - end - - return result -end - -ft.do_filetype = function(filetype) - local ftplugins = ft.find_lua_ftplugins(filetype) - - local f_env = setmetatable({ - -- Override print, so the prints still go through, otherwise it's confusing for people - print = vim.schedule_wrap(print), - }, { - -- Buf default back read/write to whatever is going on in the global landscape - __index = _G, - __newindex = _G, - }) - - for _, file in ipairs(ftplugins) do - local f = loadfile(file) - if not f then - vim.api.nvim_err_writeln("Unable to load file: " .. file) - else - local ok, msg = pcall(setfenv(f, f_env)) - - if not ok then - vim.api.nvim_err_writeln("Error while processing file: " .. file .. "\n" .. msg) - end - end - end -end - -return ft diff --git a/lua/lvim/utils/hooks.lua b/lua/lvim/utils/hooks.lua index cc884523..0fe4a7fd 100644 --- a/lua/lvim/utils/hooks.lua +++ b/lua/lvim/utils/hooks.lua @@ -15,8 +15,7 @@ end ---Tip: Useful for clearing any outdated settings function M.reset_cache() _G.__luacache.clear_cache() - - plugin_loader:cache_reset() + require("lvim.plugin-loader").recompile() package.loaded["lvim.lsp.templates"] = nil Log:debug "Re-generatring ftplugin template files" |