File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ local config = {
99 " git_status" ,
1010 },
1111 add_blank_line_at_top = false , -- Add a blank line at the top of the tree.
12+ auto_clean_after_session_restore = false , -- Automatically clean up broken neo-tree buffers saved in sessions
1213 close_if_last_window = false , -- Close Neo-tree if it is the last window left in the tab
1314 -- popup_border_style is for input and confirmation dialogs.
1415 -- Configurtaion of floating window is done in the individual source sections.
Original file line number Diff line number Diff line change @@ -94,13 +94,6 @@ local define_events = function()
9494 require (" neo-tree.ui.renderer" ).update_floating_window_layouts ()
9595 end ,
9696 })
97-
98- events .subscribe ({
99- event = events .VIM_AFTER_SESSION_LOAD ,
100- handler = function ()
101- require (" neo-tree.ui.renderer" ).clean_invalid_neotree_buffers (true )
102- end ,
103- })
10497end
10598
10699local prior_window_options = {}
@@ -626,6 +619,16 @@ M.merge_config = function(user_config, is_auto_config)
626619 manager .redraw (source_name )
627620 end
628621
622+ if M .config .auto_clean_after_session_restore then
623+ require (" neo-tree.ui.renderer" ).clean_invalid_neotree_buffers (false )
624+ events .subscribe ({
625+ event = events .VIM_AFTER_SESSION_LOAD ,
626+ handler = function ()
627+ require (" neo-tree.ui.renderer" ).clean_invalid_neotree_buffers (true )
628+ end ,
629+ })
630+ end
631+
629632 events .subscribe ({
630633 event = events .VIM_COLORSCHEME ,
631634 handler = highlights .setup ,
Original file line number Diff line number Diff line change @@ -841,7 +841,6 @@ create_window = function(state)
841841 tabnr = state .tabnr ,
842842 }
843843 events .fire_event (events .NEO_TREE_WINDOW_BEFORE_OPEN , event_args )
844- M .clean_invalid_neotree_buffers (false )
845844
846845 if state .current_position == " float" then
847846 state .force_float = nil
You can’t perform that action at this time.
0 commit comments