Skip to content

Commit 4b07287

Browse files
authored
Merge pull request #323 from cameronr/main
Fix vim.fn.filereadable check in args docs
2 parents df99506 + 3fe289e commit 4b07287

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ return {
320320
-- Check if the buffer is valid and loaded
321321
if vim.api.nvim_buf_is_valid(buf) and vim.api.nvim_buf_is_loaded(buf) then
322322
local path = vim.api.nvim_buf_get_name(buf)
323-
if vim.fn.filereadable(path) == 1 then supported = supported + 1 end
323+
if vim.fn.filereadable(path) ~= 0 then supported = supported + 1 end
324324
end
325325
end
326326

@@ -345,7 +345,7 @@ Another possibility is to only save the session if there are at least two window
345345
for _, window in ipairs(windows) do
346346
local buffer = vim.api.nvim_win_get_buf(window)
347347
local file_name = vim.api.nvim_buf_get_name(buffer)
348-
if vim.fn.filereadable(file_name) then supported = supported + 1 end
348+
if vim.fn.filereadable(file_name) ~= 0 then supported = supported + 1 end
349349
end
350350
end
351351

0 commit comments

Comments
 (0)