File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ M.execute = function(args)
62
62
63
63
-- Now get the correct state
64
64
local state
65
- local default_position = nt .config [args .source ].window .position
66
- if args .position == " current" or default_position == " current" then
65
+ if args .position == " current" then
67
66
local winid = vim .api .nvim_get_current_win ()
68
67
state = manager .get_state (args .source , nil , winid )
69
68
else
@@ -88,6 +87,9 @@ M.execute = function(args)
88
87
end
89
88
90
89
-- Handle position override
90
+ local default_position = nt .config [args .source ].window .position
91
+ local current_position = state .current_position or default_position
92
+ local position_changed = args .position ~= current_position
91
93
state .current_position = args .position
92
94
93
95
-- Handle setting directory if requested
@@ -110,6 +112,9 @@ M.execute = function(args)
110
112
111
113
-- All set, now show or focus the window
112
114
local force_navigate = path_changed or do_reveal or state .dirty
115
+ if position_changed then
116
+ manager .close (args .source )
117
+ end
113
118
if do_reveal then
114
119
handle_reveal (args , state )
115
120
else
You can’t perform that action at this time.
0 commit comments