Skip to content

Commit 3d11c92

Browse files
authored
Merge branch 'chore-remove-vim-quote-requires-quote' into sync-close-through-tabs
2 parents 32b942b + 5e1d7ff commit 3d11c92

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

lua/nvim-tree/actions/node/open-file.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end
1515

1616
---Get all windows in the current tabpage that aren't NvimTree.
1717
---@return table with valid win_ids
18-
local function selectable_win_ids()
18+
local function usable_win_ids()
1919
local tabpage = vim.api.nvim_get_current_tabpage()
2020
local win_ids = vim.api.nvim_tabpage_list_wins(tabpage)
2121
local tree_winid = view.get_winnr(tabpage)

lua/nvim-tree/renderer/components/full-name.lua

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ end
1212

1313
-- reduce signcolumn/foldcolumn from window width
1414
local function effective_win_width()
15-
local win_width = fn.winwidth(0)
15+
local win_width = vim.fn.winwidth(0)
1616

1717
-- return zero if the window cannot be found
18-
local win_id = fn.win_getid()
18+
local win_id = vim.fn.win_getid()
1919

2020
if win_id == 0 then
2121
return win_width
2222
end
2323

2424
-- if the window does not exist the result is an empty list
25-
local win_info = fn.getwininfo(win_id)
25+
local win_info = vim.fn.getwininfo(win_id)
2626

2727
-- check if result table is empty
2828
if next(win_info) == nil then
@@ -52,14 +52,17 @@ local function show()
5252
return
5353
end
5454

55-
local width = vim.fn.strdisplaywidth(vim.fn.substitute(line, "[^[:print:]]*$", "", "g"))
56-
if width < vim.fn.winwidth(0) then
55+
local text_width = vim.fn.strdisplaywidth(vim.fn.substitute(line, "[^[:print:]]*$", "", "g"))
56+
local win_width = effective_win_width()
57+
58+
if text_width < win_width then
5759
return
5860
end
61+
5962
M.popup_win = vim.api.nvim_open_win(vim.api.nvim_create_buf(false, false), false, {
6063
relative = "win",
6164
bufpos = { vim.fn.line "." - 2, 0 },
62-
width = math.min(width, vim.o.columns - 2),
65+
width = math.min(text_width, vim.o.columns - 2),
6366
height = 1,
6467
noautocmd = true,
6568
style = "minimal",

lua/nvim-tree/utils.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
local has_notify, notify = pcall(require, "notify")
2-
31
local Iterator = require "nvim-tree.iterators.node-iterator"
42

53
local M = {

0 commit comments

Comments
 (0)