Error "No Mercurial repository found above ..." when I switch buffers

Create issue
Issue #11 invalid
Philip Jag created an issue

I'm using a.vim to easily switch between .h and .cpp files of a C++ project that is not in a mercurial repository. When I activate the command to switch files I get this error message displayed:

lawrencium: No Mercurial repository found above: /cygdrive/path/to/file/Im/editing.cpp

and have to acknowledge it (<CR> or <ESC>) before the file will change.

This shouldn't be an error that gets displayed to me because I know the file isn't in a mercurial repository. I think lawrencium should just silently do nothing when I switch buffers like this.

Comments (6)

  1. Ludovic Chabant repo owner

    It's working fine on my machine... could you enable debug logger in Lawrencium so we can see what's going on? :call lawrencium#debugtrace(1). Thanks.

  2. Philip Jag reporter

    It looks like s:setup_buffer_commands() is never getting called when I switch to a file using a.vim.

    Here's the augroup that is supposed to catch it.

    augroup lawrencium_detect
         autocmd!
         autocmd BufNewFile,BufReadPost *     call s:setup_buffer_commands()
         autocmd VimEnter               *     if expand('<amatch>')==''|call s:setup_buffer_commands()|endif
    augroup end
    

    I looks like a.vim just runs silent! execute ":e".bang." " . FILENAME so I'm not sure what's going on here. Running e: myfile.cpp works fine for me.

  3. Philip Jag reporter

    Hmm, this bug happens slightly differently for the first buffer I open.

    I'm experiencing these symptoms:

    • vim myfile.h
    • use a.vim to switch to myfile.cpp. I see the error message echo'd, but I don't have to hit any key to make it go away. (Note that if I skip this step the following steps still happen).
    • :tabnew anotherfile.h (or :e)
    • use a.vim to switch to anotherfile.cpp. I get the error message now followed by the Press ENTER or type command to continue prompt.
    • I can still use a.vim for myfile

    I'm not using a minimal vimrc, so it could be a conflict with another plugin I'm using. I certainly don't expect you to debug my specific vimrc, but if you have any idea what's causing this issue in lawrencium I'd be grateful if you pointed me in a direction.

  4. Philip Jag reporter

    If I change BufReadPost to BufEnter in the lawrencium_detect autogroup I only see the issue when I switch to a file the first time, after that everything works as expected.

  5. Ludovic Chabant repo owner

    Could you have a 3rd plugin that messes things up? (or me a plugin that hides the issue?)

    I tried reproducing the bug:

    • Install a.vim
    • Create foo.cpp and foo.h somewhere
    • Open foo.cpp
    • Switch with :A

    I don't see the error message... am I missing something?

  6. Log in to comment