File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ local merge_content = function(context)
187187 -- * Repeat until all layers have been merged.
188188 -- * Join the left and right tables together and return.
189189 --
190- local huge_number = 2000
190+ local huge_number = vim . o . columns
191191 local remaining_width = context .auto_expand_width and huge_number or context .container_width
192192 local left , right = {}, {}
193193 local left_width , right_width = 0 , 0
Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ local prepare_node = function(item, state)
345345 end
346346 state .longest_width_exact = math.max (
347347 state .longest_width_exact ,
348- vim .api .nvim_strwidth (line :content ()) + 1
348+ vim .api .nvim_strwidth (line :content ())
349349 )
350350 end
351351
@@ -934,9 +934,14 @@ render_tree = function(state)
934934 state .window .last_user_width = vim .api .nvim_win_get_width (0 )
935935 if state .longest_width_exact > state .window .last_user_width then
936936 log .trace (
937- string.format (" ` auto_expand_width: on. Expanding width to %s." , state .longest_width_exact )
937+ string.format (" auto_expand_width: on. Expanding width to %s." , state .longest_width_exact )
938938 )
939939 vim .api .nvim_win_set_width (0 , state .longest_width_exact )
940+ if state .longest_width_exact > vim .api .nvim_win_get_width (0 ) then
941+ log .error (" Not enough width to expand. Aborting." )
942+ state .longest_width_exact = vim .api .nvim_win_get_width (0 )
943+ return
944+ end
940945 state .win_width = state .longest_width_exact
941946 render_tree (state )
942947 end
You can’t perform that action at this time.
0 commit comments