diff --git a/lua/lualine/components/filename.lua b/lua/lualine/components/filename.lua index 39c4728..659aa03 100644 --- a/lua/lualine/components/filename.lua +++ b/lua/lualine/components/filename.lua @@ -29,7 +29,8 @@ end local function is_new_file() local filename = vim.fn.expand('%') - return vim.bo.buftype == '' and vim.fn.filereadable(filename) == 0 + return filename ~= '' and vim.bo.buftype == '' and + vim.fn.filereadable(filename) == 0 end ---shortens path by turning apple/orange -> a/orange