Jump to content
Sign in to follow this  
roach4411

SciTE Ctrl-J

Recommended Posts

roach4411

If you are on a line that has a function call, Ctrl-J bookmarks the line and jumps to the beginning of the function. This works great if the function is in the same file but I was wondering if there is any way to jump back from a function that is #included in a different file?

Thanks,

hp

Share this post


Link to post
Share on other sites
Jos

If you are on a line that has a function call, Ctrl-J bookmarks the line and jumps to the beginning of the function. This works great if the function is in the same file but I was wondering if there is any way to jump back from a function that is #included in a different file?

Thanks,

hp

Click on the tab of the source file and hit F2 :)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
roach4411

Does anyone know what it would take to implement this feature? I'd be willing to do it, but I need to be pointed in the right direction...

Thanks,

hp

Share this post


Link to post
Share on other sites
Jos

Does anyone know what it would take to implement this feature? I'd be willing to do it, but I need to be pointed in the right direction...

Thanks,

hp

Just wondering what you are thinking of here?

The way it currently works is that the line you do the Ctrl+J on is Bookmarked and then the Func is searched...first in the script and then the #included files.

F2( jump to bookmark) jumps to the "next" bookmark in the same file ... would you want it to jump to the next bookmark in any openfile or assign a new shortkey to jump back ?

Just thinking out loud here ... :)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
roach4411

Thanks for the quick response Jos. I'd like to be able to jump back to the to the function call not the next bookmark. The idea is to be able to get a quick look at the function, it's parameters and it's implementation and then jump back to the Function call. As and example, Vim does this with Ctrl-] and Ctrl-T.

Thanks,

hp

Just wondering what you are thinking of here?

The way it currently works is that the line you do the Ctrl+J on is Bookmarked and then the Func is searched...first in the script and then the #included files.

F2( jump to bookmark) jumps to the "next" bookmark in the same file ... would you want it to jump to the next bookmark in any openfile or assign a new shortkey to jump back ?

Just thinking out loud here ... :)

Share this post


Link to post
Share on other sites
Jos

A multilevel jump-back is implemented in the current Beta version of SciTE4AutoIt3.

Ctrl+J will Jump to the appropriate Func definition and Ctrl+Shift+J will jump back to the previous location.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
MrCreatoR

A multilevel jump-back is implemented in the current Beta version of SciTE4AutoIt3.

Thanks for that one :P

Btw, "Jump to func" have one issue:

_MyFunc1(_MyFunc2())

Func _MyFunc1($Param)
    
EndFunc

Func _MyFunc2()
    
EndFunc

Just put the cursor to the begining of _MyFunc2() (inside _MyFunc1()), and press Ctrl+J, the console show this error:

C:\PROGRA~1\AutoIt3\SciTE\AutoIt3.lua:377: unfinished capture
>Lua: error occurred while processing command

Is this way it should be? :D

P.S

If you select the function name, or set spaces between the brakets, the jump performed correctly ;)


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites
Jos

Added the last line in this block of code in file AutoItGotoDefinition.Lua at line 54 will fix that issue:

function AutoItGotoDefinition:GotoDefinition(version)
    -- Get the current word.
    local func = self:GetWord()
    func = func:gsub("%(","")

:D

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Valik

Actually, Jos, that's not the fix. The fix is to stop it at it's source, which is in Common:GetWord(). Notice the "true" parameter in WordStartPosition()/WordEndPosition(), it means only get word characters:

function Common:GetWord()
    -- This pattern checks to see if a string is empty or all whitespace.
    local pattern = "^%s*$"
    -- First, get the selected text.
    local word = editor:GetSelText()
    if word:match(pattern) then
        -- No text was selected, try getting the word where the caret is.
        word = editor:textrange(editor:WordStartPosition(editor.CurrentPos, true),
            editor:WordEndPosition(editor.CurrentPos, true))
        if word:match(pattern) then
            -- No text found anywhere, set as an empty string.
            word = ""
        end
    end
    return word:gsub("^%s*", "")
end -- GetWord()

Share this post


Link to post
Share on other sites
MrCreatoR

Added the last line in this block of code in file AutoItGotoDefinition.Lua

Thanks, but i have no such file in my SciTE directory :D only AutoIt3.lua... but i can't find GotoDefinition function.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites
Jos

These updates are for the current Beta version of SciTE4AutoIt3 which has a whole new set of LUA files in a separate directory called LUA.

:D

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
MrCreatoR

Again i must to post in old topic, i didn't wanted to create a new one (which will duplicate this one).

There is few more bugs in the GotoDefinition:

1) After we use Ctrl + J (not the menu item), we can't use it again, there is no reaction after that. The hotkey works again only after we use menu item (Jump to function).

2) GotoDefinition does not take in count the includes pathes that stored in the registry (HKEY_CURRENT_USERSoftwareAutoIt v3AutoItIncludes), can be set with the Include Manager.

Btw, the 2) issue is also applied to OpenInclude lua function.


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites
Jos

Again i must to post in old topic, i didn't wanted to create a new one (which will duplicate this one).

There is few more bugs in the GotoDefinition:

1) After we use Ctrl + J (not the menu item), we can't use it again, there is no reaction after that. The hotkey works again only after we use menu item (Jump to function).

2) GotoDefinition does not take in count the includes pathes that stored in the registry (HKEY_CURRENT_USERSoftwareAutoIt v3AutoItIncludes), can be set with the Include Manager.

Btw, the 2) issue is also applied to OpenInclude lua function.

1) Works fine for me. Ctrl+J jumps to the next Func, also multiple times, and Shift+Ctrl+J jumps back in the reverse sequence.

2) LUA cannot use the Registry and is using the settings for:

openpath.$(au3)=$(SciteDefaultHome)..include;$(SciteDefaultHome)..priveincludes
openpath.beta.$(au3)=$(SciteDefaultHome)..betainclude;$(SciteDefaultHome)..betapriveincludes
Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.