fix(filename): use columns for shortening if using global statusline (#617)

This commit is contained in:
Fitrah Muhammad 2022-03-18 22:08:52 +08:00 committed by GitHub
parent 7db1db3cd9
commit 181b14348f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ M.update_status = function(self)
end end
if self.options.shorting_target ~= 0 then if self.options.shorting_target ~= 0 then
local windwidth = vim.fn.winwidth(0) local windwidth = self.options.globalstatus and vim.go.columns or vim.fn.winwidth(0)
local estimated_space_available = windwidth - self.options.shorting_target local estimated_space_available = windwidth - self.options.shorting_target
local path_separator = package.config:sub(1, 1) local path_separator = package.config:sub(1, 1)