Add NvimTreeResize to resize the NvimTree window (#497)
This commit is contained in:
parent
102c4c2332
commit
07dd10663a
@ -49,6 +49,11 @@ It will also open the leafs of the tree leading to the file in the buffer
|
||||
|
||||
Print clipboard content for both cut and copy
|
||||
|
||||
|:NvimTreeResize| *:NvimTreeResize*
|
||||
|
||||
Resize the NvimTree window to the given size. Example: `:NvimTreeresize 50`
|
||||
resizes the window to the width of 50.
|
||||
|
||||
==============================================================================
|
||||
OPTIONS *nvim-tree-options*
|
||||
|
||||
|
||||
@ -158,6 +158,11 @@ function M.find_file(with_open)
|
||||
lib.set_index_and_redraw(filepath)
|
||||
end
|
||||
|
||||
function M.resize(size)
|
||||
view.View.width = size
|
||||
view.resize()
|
||||
end
|
||||
|
||||
function M.on_leave()
|
||||
vim.defer_fn(function()
|
||||
if not view.win_open() then
|
||||
|
||||
@ -40,6 +40,7 @@ command! NvimTreeToggle lua require'nvim-tree'.toggle()
|
||||
command! NvimTreeRefresh lua require'nvim-tree'.refresh()
|
||||
command! NvimTreeClipboard lua require'nvim-tree'.print_clipboard()
|
||||
command! NvimTreeFindFile lua require'nvim-tree'.find_file(true)
|
||||
command! -nargs=1 NvimTreeResize lua require'nvim-tree'.resize(<args>)
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
Loading…
Reference in New Issue
Block a user