Re: current function in macro

Eric Promislow <[email protected]> Mon, 03 Jan 2011 12:42:14 -0800
Newsgroups gmane.comp.ide.komodo.general
Message-ID <[email protected]>
This question came in just before I went on break.  Please excuse the delay.

How about this code:

var view = ko.views.manager.currentView;
var scimoz = view.scimoz;
var ciBuf = view.koDoc.ciBuf;
var x = ciBuf.curr_section_from_line(view.currentLine);
alert(x); // => "[xpconnect wrapped koICodeIntelSection]"
alert(x.title); => gives name of current method.

Happy New Year,
Eric

On 12/22/2010 11:02 AM, Anton Visser wrote:
> I have a PHP class with several methods in it.  Is it possible using a
> macro to get the method that the cursor is in?
>
> for instance
>
> class foo {
>
> public function a() {
>
> }
>
> public function b() {
>     <cursor here>
> }
>
> public function c() {
>
> }
>
> }
>
>
> The macro function would tell me that the cursor is in method b.
>
> cheers,
> Anton
> _______________________________________________
> Komodo-discuss mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss
_______________________________________________
Komodo-discuss mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss