From 3fe289e21c7ee8479951f14a403622008e92034b Mon Sep 17 00:00:00 2001 From: Cameron Ring Date: Mon, 8 Jul 2024 19:03:48 -0700 Subject: [PATCH] Fix vim.fn.filereadable check in args docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a10090..954d15b 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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