File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1149,11 +1149,13 @@ render_tree = function(state)
11491149 state .tree :render ()
11501150 end
11511151 state ._in_pre_render = false
1152+ local textoffset = vim .fn .getwininfo (state .winid )[1 ].textoff or 0
1153+ local desired_width = state .longest_node + textoffset
11521154 state .window .last_user_width = vim .api .nvim_win_get_width (state .winid )
1153- if should_auto_expand and state . longest_node > state .window .last_user_width then
1155+ if should_auto_expand and desired_width > state .window .last_user_width then
11541156 log .trace (string.format (" auto_expand_width: on. Expanding width to %s." , state .longest_node ))
1155- vim .api .nvim_win_set_width (state .winid , state . longest_node )
1156- state .win_width = state . longest_node
1157+ vim .api .nvim_win_set_width (state .winid , desired_width )
1158+ state .win_width = desired_width
11571159 end
11581160 end
11591161 if M .tree_is_visible (state ) then
You can’t perform that action at this time.
0 commit comments