Sunday, February 17, 2019

Re: mksession restore just deleted buffer

Le dimanche 17 février 2019 14:52:20 UTC+1, Salman Halim a écrit :
> On Sun, Feb 17, 2019, 07:36 <niva...@gmail.com wrote:
> Le samedi 16 février 2019 11:56:37 UTC+1, meine a écrit :
>
> > > Nothing complicated,
>
> > >
>
> > > your advise is coded in the function! geometry#MkSession()
>
> > >   silent! execute 'mks! '.g:geometry#sessionfile
>
> > >
>
> > > And this function is called just before leaving Vim (au VimLeavePre * call geometry#SaveGeometry())
>
> >
>
> > Merci!
>
> >
>
> > //meine
>
>
>
>
>
> Yes but this code does not work well...
>
>
>
> when I list buffers ":buffers", it shows me old buffer that I delete ":bd! NoBu".
>
>
>
> Then Leave Vim (so the autocmd does its job), relaunch Vim, the buffers' list contains again previous deleted buffer and a file is create at the original buffer's folder.
>
>
>
> So not working.
>
>
>
> After the "bd!", does listing buffers again confirm that it's gone?
>
no.
>
> Have you examined the contents and timestamp of the session file to see if it contains the details of that buffer?
>
timestamp is good at vim leaving and it contains infos of that buffer :

let SessionLoad = 1
if &cp | set nocp | endif
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
let v:this_session=expand("<sfile>:p")
silent only
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
set shortmess=aoO
argglobal
%argdel
$argadd ~/Desktop/thatbuffer.txt
winpos 278 74

>
> How about disabling the autocommand and manually saving the session?
>
I don't want to lose interest of autocmd but I can try.
>
> Anything in your session options or viminfo that might be contributing something?
>
just classical set sessionoptions=help,winsize,winpos

>
> Salman

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment