From 7b4b864af7e3f528f3bfdb4ab0512d2fcff3c39d Mon Sep 17 00:00:00 2001 From: Hongbo Liu Date: Tue, 9 Aug 2022 15:07:55 +0800 Subject: [PATCH] [filename] avoid new file status for unnamed (#795) --- lua/lualine/components/filename.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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