After a recent update, I started noticing erroneous behavior in a
number of my cscope mappings.  After some experimenting I discovered
that Vim is failing to execute a "cs find" command when it follows a
"cs add" command in a catch block.  This has worked fine for a long
time and through Vim 7.2.148 but stopped working at or before Vim
7.2.438.

I boiled my configuration and functions down to the following
plugin.

    ------------------------ cscope.vim ------------------------
    set laststatus=2
    set cmdheight=10

    set csverb
    set csqf=s-

    function! Csfind()
        try
            let x = y
        catch /.*/
            echo v:exception
            cs add cscope.out
            cs find s mch_early_init
            echo "Here"
        endtry
    endfunction
    ------------------------------------------------------------

The first settings just make the command/status area large enough to
display a number of messages without overwriting or stopping.

The "let x = y" was a randomly-chosen command that would generate an
error.  The 'echo "Here"' was included to demonstrate that execution
continued beyond the "cs find" command.

To demonstrate the behavior, I cd'd to my vim72/src directory (so
that others could use the same data) in which I had built a cscope
database.  Then I executed

    vim -X -N -u NONE --cmd 'runtime plugin/cscope.vim' -c 'call Csfind()'

Using Vim 7.2.148 this works correctly:  Vim opens a buffer
containing main.c with the cursor on line 181 and the following text
on the status lines:

    Vim(let):E121: Undefined variable: y
    (1 of 6): <<global>> mch_early_init();
    Here

Using Vim 7.2.438, however, this fails:  Vim opens an empty buffer
and displays this on the status lines:

    Vim(let):E121: Undefined variable: y
    Added cscope database cscope.out
    Here

A "cs find s mch_early_init" command will work if executed now,
but I need it to work immediately after the "cs add cscope.out"
command, as it used to.

With my normal ~/.vimrc, the first set of messages includes the
"Added cscope database cscope.out" line just before the "(1 of 6)"
line.  I don't know why it didn't appear in this example, but I
didn't think that detail was all that important.

Regards,
Gary

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui