fix(#2746): background and right aligned icons in floating windows (#3128)

* fix(#2746): fix cursorcolumn and right aligned icons in floating windows

* feat: remove right aligned icons from full name float, show float over right aligned icons

* refactoring: move `extmarks_length` to utils.lua

* fix: decrease `win_width` instead of increasing `text_width` when computing condition for full name float to show

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Šimon Mandlík
2025-05-24 05:19:19 +02:00
committed by GitHub
parent bd54d1d33c
commit cbc3165e08
3 changed files with 29 additions and 11 deletions

View File

@@ -329,14 +329,7 @@ local function grow()
local count = vim.fn.strchars(l)
-- also add space for right-aligned icons
local extmarks = vim.api.nvim_buf_get_extmarks(M.get_bufnr(), ns_id, { line_nr, 0 }, { line_nr, -1 }, { details = true })
for _, extmark in ipairs(extmarks) do
local virt_texts = extmark[4].virt_text
if virt_texts then
for _, virt_text in ipairs(virt_texts) do
count = count + vim.fn.strchars(virt_text[1])
end
end
end
count = count + utils.extmarks_length(extmarks)
if resizing_width < count then
resizing_width = count
end