aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-03-17 17:13:04 -0700
committerGitHub <noreply@github.com>2025-03-17 17:13:04 -0700
commit1369d86812a55d2a1a575299e05e75ea4a6a8461 (patch)
treeab6dd71498c3bdc955e3397845aa33e065ec9b3a /runtime/lua/vim
parent3b1d0e7f701b53d72e4fdf5a721d2684d055cc1d (diff)
downloadrneovim-1369d86812a55d2a1a575299e05e75ea4a6a8461.tar.gz
rneovim-1369d86812a55d2a1a575299e05e75ea4a6a8461.tar.bz2
rneovim-1369d86812a55d2a1a575299e05e75ea4a6a8461.zip
test: cleanup ftplugin_spec.lua #32948
Problem: - cannot run ftplugin_spec.lua by itself - test leaves foo/ dir Solution: - fix setup and teardown
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/_ftplugin/lua.lua8
1 files changed, 1 insertions, 7 deletions
diff --git a/runtime/lua/vim/_ftplugin/lua.lua b/runtime/lua/vim/_ftplugin/lua.lua
index 588433409b..d81393192d 100644
--- a/runtime/lua/vim/_ftplugin/lua.lua
+++ b/runtime/lua/vim/_ftplugin/lua.lua
@@ -3,18 +3,12 @@ local M = {}
--- @param module string
---@return string
function M.includeexpr(module)
- ---@param fname string
- ---@return boolean
- local function filereadable(fname)
- return vim.fn.filereadable(fname) == 1
- end
-
local fname = module:gsub('%.', '/')
local root = vim.fs.root(vim.api.nvim_buf_get_name(0), 'lua') or vim.fn.getcwd()
for _, suf in ipairs { '.lua', '/init.lua' } do
local path = vim.fs.joinpath(root, 'lua', fname .. suf)
- if filereadable(path) then
+ if vim.uv.fs_stat(path) then
return path
end
end