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

@@ -172,6 +172,21 @@ function M.find_node_line(node)
return -1
end
---@param extmarks vim.api.keyset.get_extmark_item[] as per vim.api.nvim_buf_get_extmarks
---@return number
function M.extmarks_length(extmarks)
local length = 0
for _, extmark in ipairs(extmarks) do
local details = extmark[4]
if details and details.virt_text then
for _, text in ipairs(details.virt_text) do
length = length + vim.fn.strchars(text[1])
end
end
end
return length
end
-- get the node in the tree state depending on the absolute path of the node
-- (grouped or hidden too)
---@param path string