Friday, November 27, 2009

Re: Detect when a return follow an if instruction without bracket

On 27 nov, 14:33, Andy Wokula <anw...@yahoo.de> wrote:

>
> Use the Long Pattern (from my first post):
> /)\_s*\%(\%(\/\*\_[^*]*\*\+\%(\_[^\/*]\_[^*]*\*\+\)*\/\|\/\/.*\n\)\_s*\)\{- }return
>
> Try it out ...
>
> You can turn it directly into a :subst command, e.g.
>    :%s/Long Pattern/)\r{\rreturn;\r}/
>
> Execute it, then re-indent the file (the :subst-command cannot do that).
>
> Use :DiffOrig or similar to check the result (and be able to undo certain things).
>
> --
> Andy


I have just tested your regexp and it works very all out of the case
where first closed bracket ) is into a comment.
I consider it is faster than the func I have already post that worked
too. I will measure time of process on a file tomorrow.

I would like to thank you.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: