We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c49a8c commit 2c50306Copy full SHA for 2c50306
lua/rest-nvim/utils/init.lua
@@ -27,11 +27,8 @@ end
27
-- file_exists checks if the provided file exists and returns a boolean
28
-- @param file File to check
29
M.file_exists = function(file)
30
- file = io.open(file, "rb")
31
- if file then
32
- file:close()
33
- end
34
- return file ~= nil
+ if vim.fn.filereadable(file) ~= 1 then return false end
+ return true
35
end
36
37
-- read_file Reads all lines from a file and returns the content as a table
0 commit comments