File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,11 @@ function Buffer:close(force)
214
214
end
215
215
216
216
if self .kind == " replace" then
217
+ if self .old_cwd then
218
+ api .nvim_set_current_dir (self .old_cwd )
219
+ self .old_cwd = nil
220
+ end
221
+
217
222
api .nvim_buf_delete (self .handle , { force = force })
218
223
return
219
224
end
@@ -249,6 +254,11 @@ function Buffer:hide()
249
254
vim .cmd (" silent! 1only" )
250
255
vim .cmd (" try | tabn # | catch /.*/ | tabp | endtry" )
251
256
elseif self .kind == " replace" then
257
+ if self .old_cwd then
258
+ api .nvim_set_current_dir (self .old_cwd )
259
+ self .old_cwd = nil
260
+ end
261
+
252
262
if self .old_buf and api .nvim_buf_is_loaded (self .old_buf ) then
253
263
api .nvim_set_current_buf (self .old_buf )
254
264
self .old_buf = nil
@@ -288,6 +298,7 @@ function Buffer:show()
288
298
local win
289
299
if self .kind == " replace" then
290
300
self .old_buf = api .nvim_get_current_buf ()
301
+ self .old_cwd = vim .uv .cwd ()
291
302
api .nvim_set_current_buf (self .handle )
292
303
win = api .nvim_get_current_win ()
293
304
elseif self .kind == " tab" then
You can’t perform that action at this time.
0 commit comments