Sunday, August 30, 2009

question about ShowFuncName

Dear all,

I get the following script from http://vim.wikia.com/wiki/Show_current_function_name_in_C_programs

fun! ShowFuncName()
let lnum = line(".")
let col = col(".")
echohl ModeMsg
echo getline(search("^[^ \t#/]\\{2}.*[^:]\s*$", 'bW'))
echohl None
call search("\\%" . lnum . "l" . "\\%" . col . "c")
endfun
map f :call ShowFuncName() <CR>

It works for most of the case, however, if there is some MACO used
like this,

void func_name(void)
{
MARCO;
// line x
}

it will display the MARCO name instead of function name.

Anyone would like to help? Thanks.

Regards,
Ivan

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

No comments:

Post a Comment