Документ взят из кэша поисковой машины. Адрес оригинального документа : http://jet.sao.ru/hq/sts/linux/doc/nedit/macro/2/2-05.shtml
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 10:37:52 2012
Кодировка:

Поисковые слова: п п п п п п п п п п
NEdit.org

.
.   
NEdit.org
   .

Home
 - News - Download - Documentation - Search - FTP     
.
.
  

Find definition

[Back]

 

With this you don't have to select the function before finding it's defintion, just place the cursor within the function name. The macro sets a mark before calling find_definition(), so you can go back to where you used the macro.
forward_word()
backward_word()
select($cursor, search("(", $cursor))

mark($def_mark)

$def_mark++
if ($def_mark == 10)
   $def_mark = 0

find_definition()
Use this to go back to the line containing the function call:
$def_mark--

if ($def_mark == -1)
   $def_mark = 9

goto_mark($def_mark)
You'll need to add $def_mark=0 to your .neditmacro file.


This version recognizes function names that end in a <Space> or ' as well as (.
forward_word()
backward_word()
# Does function name end with space or "(" or ' ?
space = search(" ", $cursor)
if (space < 0) {
   space = $text_length
}
quote = search("'", $cursor)
if (quote < 0 ) {
   quote = $text_lenght
}
parenth = search("(", $cursor)
if (parenth < 0)  {
   parenth = $text_length
}
endOfName = min( space, quote, parenth)
#dialog("endofname and cursor" endOfName, $cursor)
select($cursor, endOfName)

mark($def_mark)

$def_mark++
if ($def_mark == 10)
   $def_mark = 0

find_definition()
These macros obviously require you to use tags, so you might want to use something like this to update your tags file:
save()
shell_command("ctags -w -T -o .tags -C *.cpp *.h", "")
load_tags_file(".tags")
[Back]

. Released on  Wed, 21 Nov 2001  by C. Denat  

  
Visit our sponsor
Check Metrolink

© NEdit.org
1999-2001
All rights reserved


.