Hgtabdiff produce errors

Create issue
Issue #17 resolved
zdm created an issue

Environment: gvim 7.4.316 x64 MSWindows 8.1 x64 Mercurial 3.0.1

Error log:

Error detected while processing function <SNR>64_HgDiff
line 64:
E516: No buffers were deleted: bdelete 10

Comments (14)

  1. Ludovic Chabant repo owner

    Does it always give this error? I can't reproduce this at the moment. I'll try updating to Mercurial 3.0.1 (my Windows box is apparently still on 2.8.1) to see if that's the problem.

  2. Ludovic Chabant repo owner

    Actually, looking at the code, it looks like something wrong going on with Vim's behaviour when opening a new tab. It could be one of my plugins - or one of yours - getting in the way. I'll try with my plugins disabled.

  3. Ludovic Chabant repo owner

    Mmmh I also did it, but I get no exception (on gvim 7.4, Win7 x64).

    Look a lawrencium.vim, around line 1205 (it should read execute 'bdelete ' . l:cleanupbufnr). Comment out this line and try again (don't forget to close/re-open vim). You should probably not get the exception anymore. However, with the new diff tab still open, run :ls and see if you have any empty buffers in the list. The point of this line is that when Lawrencium opens a new tab with :tabnew, it creates an empty "scratch" buffer by default (named "[No Name]"), so it deletes it to keep things clean.

  4. zdm reporter

    Yes, with this string commented - no errors detected and no scratch buffers leaves in buffer list.

  5. Ludovic Chabant repo owner

    That's really weird. When I comment out that line, I'm left with an empty buffer in my buffer list. Maybe there's some setting somewhere in Vim that I don't know about that cleans it up for you but not for me, or something like that?

    Either way, I could conditionally check if there is indeed a buffer in the new tab, in addition to the diff buffers, and not clean it if it's not there...

  6. zdm reporter

    Maybe you need to create hidden buffers, and then open them in a new tab, so no scratch will be created automatically.

  7. Ludovic Chabant repo owner

    Mmmmh, sounds like that buffer you have is some kind of unlisted/protected buffer or something, then (I originally thought the error was that the buffer didn't exist for you, but apparently not)... When Vim complains about "No buffers were deleted", it tells you what buffer number it tried to delete (it was "10" in your original message). Can you see what buffer that is by using :ls!, which should show you "unlisted" buffers? Thanks!

  8. Ludovic Chabant repo owner

    Actually, a more correct fix would be to change my 7770633 patch and replace bufexists with bufloaded, or possibly buflisted. You could try that too.

  9. Log in to comment