Skip to content

Commit

Permalink
Merge pull request #323 from cameronr/main
Browse files Browse the repository at this point in the history
Fix vim.fn.filereadable check in args docs
  • Loading branch information
rmagatti authored Jul 9, 2024
2 parents df99506 + 3fe289e commit 4b07287
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ return {
-- Check if the buffer is valid and loaded
if vim.api.nvim_buf_is_valid(buf) and vim.api.nvim_buf_is_loaded(buf) then
local path = vim.api.nvim_buf_get_name(buf)
if vim.fn.filereadable(path) == 1 then supported = supported + 1 end
if vim.fn.filereadable(path) ~= 0 then supported = supported + 1 end
end
end

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

Expand Down

0 comments on commit 4b07287

Please sign in to comment.