Skip to content

Commit 063cc44

Browse files
authored
fix: recalculate filename widths when max width option changes (#67)
1 parent 2d3f327 commit 063cc44

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lua/quicker/display.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,18 @@ M.get_filename_from_item = function(item)
7171
end
7272

7373
local _col_width_cache = {}
74+
local _last_max_width = nil
75+
7476
---@param id integer
7577
---@param items QuickFixItem[]
7678
---@return integer
7779
local function get_cached_qf_col_width(id, items)
80+
local current_max_width = config.max_filename_width()
81+
if _last_max_width ~= current_max_width then
82+
_col_width_cache = {}
83+
_last_max_width = current_max_width
84+
end
85+
7886
local cached = _col_width_cache[id]
7987
if not cached or cached[2] ~= #items then
8088
local max_len = 0

0 commit comments

Comments
 (0)