Peter Slizik wrote: > I've been playing with the following piece of code: > > try > global/\v^\s*\+\+\+\s*$/delete > catch > echo "catch clause" > finally > echo "finally clause" > endtry > > It should remove the lines containing only three +'s from a file. I'm using > the try clause to prevent the error message being displayed if there are no > lines to be removed. However, the error is not caught. If I replace the > search command with another arbitrary command, everything works as expected. > Could it be a bug?
The situation that ":global" does not find a match is not handled like an error message but like a normal message. This is for Vi compatibility. I think you can suppress the message by using ":silent global", haven't tried it. -- Q: Why does /dev/null accept only integers? A: You can't sink a float. /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
