Wednesday, March 31, 2010

Checking return codes?

Hi All,

Is it possible to check the return code of an Ex command? I currently have:

function! Grep(pattern, location)
exe "noautocmd vimgrep /" . a:pattern . "/gj " . a:location " | copen"
endfunction

which causes an error with copen if vimgrep doesn't return anything.
I'd like to handle the error a little more gracefully if possible.

Thank you,

Chris

--
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d

--
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

To unsubscribe, reply using "remove me" as the subject.

No comments:

Post a Comment