mirror of
https://github.com/neovim/neovim.git
synced 2026-07-25 02:10:45 +00:00
feat(api): add nvim_win_resize()
Ref #6645 Problem: When a window is resized it takes space from the window right/below first, and only falls back to the window left/above when there is no more room. Sometimes a user wants the space to come from a specific direction. Solution: Add nvim_win_resize(win, width, height, {anchor}) which resizes a window with a choosable anchor edge, letting a window grow leftwards or upwards by taking space from the window to the left or above first. The default anchor reproduces nvim_win_set_width()/nvim_win_set_height().
This commit is contained in:
@@ -677,7 +677,7 @@ local function update_popup_window(winid, bufnr, kind)
|
||||
vim.treesitter.start(bufnr, kind)
|
||||
end
|
||||
local all = api.nvim_win_text_height(winid, {}).all
|
||||
api.nvim_win_set_height(winid, all)
|
||||
api.nvim_win_resize(winid, -1, all, {})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user