On Fri, Apr 3, 2009 at 5:49 PM, Dasn <[email protected]> wrote: > hi, vimmers. > > I am writing a script in which it attempts to add a breakpoint on > current line if there defines a function. > > " breakadd on current line > let pat = '\v^\s*:?fu(|n|nc|nct|ncti|nctio|nction)\s*!?\s*(\w+)\s*\(.{-}\)' > let m = matchlist(getline('.'), pat) > if len(m) > 3 && m[2] != "" > exe "breakadd func" m[2] > else > echo "No function definition on current line." > endif > > As you can see, the most ugly part is the pattern: > '\v^\s*:?fu(|n|nc|nct|ncti|nctio|nction)\s*!?\s*(\w+)\s*\(.{-}\)' > > Can you please help me to rewrite this pattern, especially the > part matches 'fu[nction]'?
\<fu\%[nction]\> for the tricky part. See :help /\%[] -- /George V. Reilly [email protected] http://www.georgevreilly.com/blog http://blogs.cozi.com/tech --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
