瀏覽代碼

Sessions: only prune unlisted buffers from arglist

References #110.
Marco Hinz 11 年之前
父節點
當前提交
af2368cd75
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      autoload/startify.vim

+ 5 - 1
autoload/startify.vim

@@ -234,7 +234,11 @@ function! startify#session_write(spath)
       unlet s:callingbuffer
     endif
     " prevent saving already deleted buffers that were in the arglist
-    silent! argdelete *
+    for arg in argv()
+      if !buflisted(arg)
+        execute 'argdelete' fnameescape(arg)
+      endif
+    endfor
     set sessionoptions-=options
     execute 'mksession!' a:spath
   catch