@@ -6,6 +6,7 @@ local view = require'nvim-tree.view'
|
||||
|
||||
local M = {
|
||||
quit_on_open = false,
|
||||
resize_window = false,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
@@ -208,7 +209,9 @@ function M.fn(mode, filename)
|
||||
cmd = cmd .. vim.fn.fnameescape(filename)
|
||||
api.nvim_set_current_win(target_winid)
|
||||
pcall(vim.cmd, cmd)
|
||||
view.resize()
|
||||
if M.resize_window then
|
||||
view.resize()
|
||||
end
|
||||
end
|
||||
|
||||
if mode == "preview" then
|
||||
|
||||
@@ -87,9 +87,9 @@ local migrations = {
|
||||
end,
|
||||
|
||||
nvim_tree_auto_resize = function(o)
|
||||
utils.table_create_missing(o, "view")
|
||||
if o.view.auto_resize == nil then
|
||||
o.view.auto_resize = vim.g.nvim_tree_auto_resize ~= 0
|
||||
utils.table_create_missing(o, "actions.open_file")
|
||||
if o.actions.open_file.resize_window == nil then
|
||||
o.actions.open_file.resize_window = vim.g.nvim_tree_auto_resize ~= 0
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
@@ -324,7 +324,6 @@ local DEFAULT_CONFIG = {
|
||||
width = 30,
|
||||
height = 30,
|
||||
side = 'left',
|
||||
auto_resize = false,
|
||||
preserve_window_proportions = false,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
@@ -337,7 +336,6 @@ function M.setup(opts)
|
||||
M.View.width = options.width
|
||||
M.View.height = options.height
|
||||
M.View.hide_root_folder = options.hide_root_folder
|
||||
M.View.auto_resize = options.auto_resize
|
||||
M.View.preserve_window_proportions = options.preserve_window_proportions
|
||||
M.View.winopts.number = options.number
|
||||
M.View.winopts.relativenumber = options.relativenumber
|
||||
|
||||
Reference in New Issue
Block a user