Quantcast

Undead buffer: gets deleted but respawns on session launch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Undead buffer: gets deleted but respawns on session launch

Sylvia Ganush
Good day.

What may cause a deleted buffer to reappear on session launch?

I once edited a file, a Figlet font. I deleted the buffer, and
then exited Vim as I usually do:

    :mksession! session.vim
    :wqa

But when restart the session the deleted buffer is still present on the
:ls list. The buffer itself is empty. A 'ghost', if you wish.

What gives?

Regards,

Sylvia

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Undead buffer: gets deleted but respawns on session launch

Ben Fritz
On Tuesday, April 23, 2013 10:41:08 AM UTC-5, Sylvia Ganush wrote:
>
> What may cause a deleted buffer to reappear on session launch?
>

Maybe you have the % character in your 'viminfo' option? You said you deleted the buffer, though, so I'd expect it would not be in the saved list. What command did you use to delete the buffer?

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Undead buffer: gets deleted but respawns on session launch

Tony Mechelynck
In reply to this post by Sylvia Ganush
On 23/04/13 17:41, Sylvia Ganush wrote:

> Good day.
>
> What may cause a deleted buffer to reappear on session launch?
>
> I once edited a file, a Figlet font. I deleted the buffer, and
> then exited Vim as I usually do:
>
>      :mksession! session.vim
>      :wqa
>
> But when restart the session the deleted buffer is still present on the
> :ls list. The buffer itself is empty. A 'ghost', if you wish.
>
> What gives?
>
> Regards,
>
> Sylvia
>

The :ls! list (but not the :ls list without bang) contains buffers
previously edited, even if deleted.

See ":help :bwipeout" and the last paragraph under ":help :bdelete". See
also ":help unlisted-buffer".


Best regards,
Tony.
--
According to the obituary notices, a mean and unimportant person never
dies.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Undead buffer: gets deleted but respawns on session launch

Sylvia Ganush
In reply to this post by Ben Fritz

On 23 Apr 2013, at 19:06, Ben Fritz <[hidden email]> wrote:

> On Tuesday, April 23, 2013 10:41:08 AM UTC-5, Sylvia Ganush wrote:
>>
>> What may cause a deleted buffer to reappear on session launch?
>>
>
> Maybe you have the % character in your 'viminfo' option? You said you deleted the buffer, though, so I'd expect it would not be in the saved list. What command did you use to delete the buffer?

Hi Ben.

Here's my 'viminfo' option:

    viminfo='100,<50,s10,h,rA:,rB:

No '%' in there. The ghost buffer always has '#h' in front of its name.

To delete the buffer I do:

    :bd!

Sylvia

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Undead buffer: gets deleted but respawns on session launch

Ben Fritz
In reply to this post by Sylvia Ganush
On Tuesday, April 23, 2013 10:41:08 AM UTC-5, Sylvia Ganush wrote:

> Good day.
>
>
>
> What may cause a deleted buffer to reappear on session launch?
>
>
>
> I once edited a file, a Figlet font. I deleted the buffer, and
>
> then exited Vim as I usually do:
>
>
>
>     :mksession! session.vim
>
>     :wqa
>
>
>
> But when restart the session the deleted buffer is still present on the
>
> :ls list. The buffer itself is empty. A 'ghost', if you wish.
>
>
>
> What gives?
>

:help :mksession says:

7. Reloads the buffer list, with the last cursor positions.  If
   'sessionoptions' contains "buffers" then all buffers are restored,
   including hidden and unloaded buffers.  Otherwise only buffers in windows
   are restored.

So, after reading Tony's response, I expect you could solve this either by removing 'buffers' from your sessionoptions, or by using :bwipe instead of :bd to delete the buffer.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Undead buffer: gets deleted but respawns on session launch

Tony Mechelynck
In reply to this post by Sylvia Ganush
On 24/04/13 20:56, Sylvia Ganush wrote:

>
> On 23 Apr 2013, at 19:06, Ben Fritz <[hidden email]> wrote:
>
>> On Tuesday, April 23, 2013 10:41:08 AM UTC-5, Sylvia Ganush wrote:
>>>
>>> What may cause a deleted buffer to reappear on session launch?
>>>
>>
>> Maybe you have the % character in your 'viminfo' option? You said you deleted the buffer, though, so I'd expect it would not be in the saved list. What command did you use to delete the buffer?
>
> Hi Ben.
>
> Here's my 'viminfo' option:
>
>      viminfo='100,<50,s10,h,rA:,rB:
>
> No '%' in there. The ghost buffer always has '#h' in front of its name.
>
> To delete the buffer I do:
>
>      :bd!
>
> Sylvia
>

#h means a hidden buffer, which is the alternate buffer (i.e. usually
the last buffer you edited before the current one).

Try :bw! instead of :bd! and see if there is a difference. But beware!
:bw forgets *everything* that Vim has in memory concerning that buffer.


Best regards,
Tony.
--
        FIGHTING WORDS

Say my love is easy had,
        Say I'm bitten raw with pride,
Say I am too often sad --
        Still behold me at your side.

Say I'm neither brave nor young,
        Say I woo and coddle care,
Say the devil touched my tongue --
        Still you have my heart to wear.

But say my verses do not scan,
        And I get me another man!
                -- Dorothy Parker

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Undead buffer: gets deleted but respawns on session launch

Sylvia Ganush
In reply to this post by Ben Fritz

On 25 Apr 2013, at 00:06, Ben Fritz <[hidden email]> wrote:

> So, after reading Tony's response, I expect you could solve this either by removing 'buffers' from your sessionoptions, or by using :bwipe instead of :bd to delete the buffer.

Thank you Ben, thank you Tony.

I gave up and simply recreated the session.

The offending buffer just wouldn't die no matter what. ':bw!' didn't get it,
nor did ':set sessionoptions-=buffers'.

Maybe I was doing something wrong, but I open dozens of other files and delete
the respective buffers, but only this one stuck inside the session for some
reason. The stars must have aligned in a certain way at its birth. ;-)

Sylvia

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Undead buffer: gets deleted but respawns on session launch

Victoria Stuart
In reply to this post by Sylvia Ganush
On Tuesday, April 23, 2013 at 8:41:08 AM UTC-7, Sylvia Ganush wrote:

> Good day.
>
> What may cause a deleted buffer to reappear on session launch?
>
> I once edited a file, a Figlet font. I deleted the buffer, and
> then exited Vim as I usually do:
>
>     :mksession! session.vim
>     :wqa
>
> But when restart the session the deleted buffer is still present on the
> :ls list. The buffer itself is empty. A 'ghost', if you wish.
>
> What gives?
>
> Regards,
>
> Sylvia
http://stackoverflow.com/questions/5238251/deleting-buffer-from-vim-session/41683144#41683144



Ok: this was annoying me, too. I have a command (Arch Linux: Krusader file manager)

vim --remote

that enables me to right-click a file in Krusader and open that fike in Vim. I also save Vim sessions via my ~/.vimrc:

" Save session on quitting Vim:
autocmd! VimLeave * mksession! ~/.vim/vim_session.vim
" mksession! overwrites old session

" Restore session on starting Vim:
autocmd! VimEnter * source ~/.vim/vim_session.vim

However, a file I opened externally via vim --remote, e.g.

/mnt/Vancouver/Programming/scripts/chunk.sh

stubbornly persists between sessions, even after doing the usual :bd, :bw, :bw! etc. commands, and/or deleting the vim session file.

Looking at the vim_session.vim file, I noted an 'argadd' line with the offending, persistent file:

argadd /mnt/Vancouver/Programming/scripts/chunk.sh

So,

:help arglist

:argd /mnt/Vancouver/Programming/scripts/chunk.sh
" delete that arg

Finally, clear that file from the buffer list (:bd). Restart Vim: the previous session is restored, minus that file.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Undead buffer: gets deleted but respawns on session launch

Felipe Vieira
In reply to this post by Sylvia Ganush
I have reported the same problem:

https://groups.google.com/forum/#!topic/vim_use/qL4--7akXS4

Looks like you are not the only one.

Since we found a workaround but the behavior seems to be wrong I have opened a github issue:

https://github.com/vim/vim/issues/1393

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...