Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

ISense 1.5.4


  • Please log in to reply
325 replies to this topic
majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Well, original plan was to support other languages. I still stick to that, as I created it so I am able to use it with some rare language I use.

Don't know how when I will find thime for this.


But, if you really want to have it with your language of choice and want to pay that work I can find time to that. In current situation I don't know when will I be able to work on it, and how will I handle other languages.

I am alo planing to add user functions and variables any way, and fix some issues with weird editors.

Thank you for your comments.
Posted Image

  • Guests
  • Last active:
  • Joined: --
Bumping...

There are so many superb scripts around here! The search funtion just doesn't find it, and a decent overview is missing.

Thank you

TheIrishThug
  • Members
  • 419 posts
  • Last active: Jan 18 2012 02:51 PM
  • Joined: 19 Mar 2006
Whoever you were, thank you so much for the bump. Never would have known it existed.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Thx.

FYI, I plan to update this script greatly. Some bugs noticed so far will be fixed, I plan to document editors that are confirmed to work without problems and vice-versa, and most important, user functions and variables will be added in ISense list so you never have to type long variable names or functions you just created.

Don't know when though...:D

About overview, we currently have some inititive for organisation of scripts so they are not lost in space and time...
Posted Image

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
ISense 1.1 released:

- Added plugins (method) to support different editors.


Posted Image



You can also press CTRL SPACE on any part of the line at any time. ISense will grab that line and try to locate
the AHK command and current parameter. This procedure is editor specific so if it doesn't work with your
editor choose different method or write your own.


HOW TO WRITE METHOD

Methods are located in includes\editor folder, with "Method N.ahk" names. Method is single AHK function,
ISense_GetLine witch returns text from the current cursor position to the beginning of the line, for
supported editors. One method may fit multiple editors, like it is usualy the case, so this file also contains INI section
[EDITOR] where you specify supported editors for that method.

To write new method, start by duplicating some of the method files. Save it under any name that doesn't
exist and replace the internals of the ISense_GetLine function. Whatever you do, cursor must be returned
to the same position as before you stared. When you grab the line, return it to the ISense, and thats all.
Afterwards, go to Setup and activate the new method witch will be visible in the list as soon as you save it.\
All supported editors specified by the INI part of the method will also be added to the editor list.

When you discover that your editor works with some of the already present methods and editor itself is not
in the editor list, please inform me on the forum so I can update the editor list. Do the same if you wrote
the new method for your editor.

Current method is includes\Method.ahk

Currently, there are 3 methods for witch are following editors tested:
EditPlus, EmEditor, PSPad, Scite, UltraEdit, SynPlus, Notepad, Metapad, Syn

In setup section you can choose editor if in the list, otherwise, you can try
one of the methods as your editor will probably fall into one of the available categories.


NOTES

Tracing tooltip can be enabled for debuging. To enable it, uncomment line
1:

1: Isense_trace := true

If you find any bug make sure nobody reported it (check out the BUGS section) before posting it.
Suggestions & feedback are appreciated.


TO-DO

- User variables and functions (per project) [soon]
- Language definition file so it is able to work with other languages. [very distant]
Posted Image

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
version 1.1 beta 2

- I tried to fix the "deactivation bug" that appear sometimes on script start by replacing the IE control with another one, but it seems that the problem is in some strange behvior of IE control itself combined with AHK usage, or something.... So I created workaround that will try to fix things once bug is recognised, so it should appear much less frequent.

- some small fixes
Posted Image

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Check out the new fancy gif on first page 8)
Posted Image

dash
  • Members
  • 54 posts
  • Last active: May 24 2010 01:24 PM
  • Joined: 29 Nov 2006
Almost missed it! :shock:

Amazing work, majkinetor!

AHKnow*
  • Guests
  • Last active:
  • Joined: --
This is a 5 star script. Awesome. Should be considered to be included with AutoHotkey's main package.

It was very easy for me to configure this script for Crimson Editor, but I was wondering if you could include Crimson Editor by default with your script.

Crimson Editor is free and opensource, you can look at it like a free version of EditPlus, and a number of hardcore fans still use. http://www.emeraldeditor.com/

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

It was very easy for me to configure this script for Crimson Editor, but I was wondering if you could include Crimson Editor by default with your script.

Of course I will include it, thats why I said in the readme to give me feedback about editors not currently there. Crimson works with Method 2 witch is General as it is high probability that almost all editors will work with it. Supporting this editor "officialy" is just about adding it to the Method 2 INI section :)

Note however that Method 2 is using clipboard to select the current line (while method 1 & 3 do not).

Crimson really looks like EditPlus, so I am really surprised it doesn't work with Method 1. It seems developers forgot to support standard Windows "edit API messages".
Posted Image

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
You could also ask on developers forum is there any way to select the current line up to the cursor point using windows messages. That is all what is needed to write the method for any editor. It is possible this feature exist.

So far the cleanest solution is for Notepad (Method 3) for witch you can get the current line without any workarounds so ISense shines in Notepad (and Metapad and similar). So far there are tree methods to get current line:

Method1: (edipt plus, pspad...)
Method1 editors are able to provide selection via native AHK commands (ControlGet, Select) so function select the line with Shift+Home then ask for it using ControlGet command, then cancels the selection to return the cursor. The cursor is back with simple RIGHT arrow witch positions it at the beginning of the selection.

/*
[EDITOR]
Editors=EditPlus, EmEditor, PSPad, Scite
version=1.0
*/
ISense_GetLine()
{
	;select up to the beginning
	Send +{home}
	Sleep 20

	;get selection
	ControlGetFocus, line, A
	ControlGet, line, Selected, ,%line%, A 
	Sleep 20

	;cancel selection
	Send {RIGHT}
	Sleep 20

	;return the line
	return line
}

Method2 (ultraedit, crimson...)
This is GENERAL method. Method 2 editors don't respond to native APIs in anyway, so it is imposible to ask them for the current line except doing some workaround. The workaround is this: Select the line using SHIFT HOME, copy it to clipboard and get it. Cursor is returned the funny way: before selecting I send space, and afterwards I issue UNDO witch removes the selection and returns the cursor to its starting position (this is needed because editors respond differently when right arrow is pressed on selection)

/*
[EDITOR]
Editors=General, Ultraedit, Crimson, Syn, SynPlus
version=1.0
*/

;------------------
; Neet workaround:
;  - type space
;  - select up to the beginning
;  - copy to clipboard and grab it
;  - undo space witch returns cursor to its position
;
ISense_GetLine()
{
	Send, %A_Space%

	oldClip := clipboardall
	Send,  +{HOME} 
	Send,  ^c
	Sleep, 50
	line := clipboard
	clipboard := oldClip

	Send, ^z
	Sleep, 50
	StringTrimRight, line, line, 1
	return %line%
}

Method 3 (Notepad, metapad ...)
This is basicly for junk editors witch contain 1 simple EDIT control witch can be queried for all desired elements via Native API. So, no problems at all here.

/*
[EDITOR]
Editors=Notepad, Metapad
version=1.0
*/

ISense_GetLine()
{
	ControlGet, curCol, CurrentCol
	ControlGet, curLine, CurrentLine
	ControlGet, line, Line, %curLine%

	StringMid, line, line, 1, % curCol - 1

	return, line
}

So, if you find better way for your editor of choice write it down, name it Method N and place it in includes\editors from witch point you can select it among Setup options and use it.

NOTE: I think it is possible to do this the way some dictionaries do it, like Babylon pro, witch can get the text from any place of the screen. This is currently beyond ahk AFAIK as it uses some Accessibility API witch relays on COM.
Posted Image

Veovis
  • Members
  • 389 posts
  • Last active: Mar 17 2009 12:24 AM
  • Joined: 13 Feb 2006
This is awesome majkinetor! It worked great with Programmers NotePad 2 without me even having to change anything! I like that you made it work as long as ".ahk" is in the title. And it is so cool! I love that little IE control that pops up! No more having to have half the monitor full of the help, just pop it up when you need it! A million thanks!!!
Posted Image
"Power can be given overnight, but responsibility must be taught. Long years go into its making."

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
You are welcome.
There will be some nice updates too in near future.

Thx for the feedback. I added "confirmed editors" section in the first topic

CONFIRMED EDITORS
Method1 - EditPlus, EmEditor, Programmers NotePad 2, PSPad, Scite,
Method2 - Crimson Editor, UltraEdit, SynPlus, Syn
Method3 - Notepad, Metapad
Posted Image

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
This is one of the most professionally designed and presented utilties I've seen for AutoHotkey. To help bring attention to it, I've linked to this topic from the Edit page:

Finally, your productivity may be improved by using an auto-completion utility like ISense, which works in almost any editor. It watches what you type and displays menus and parameter lists, which does some of the typing for you and reminds you of the order of parameters.

(Revisions to the wording are welcome.)

I can also add this to the script showcase if you wish, though it would help if someone could make a quick blurb like this one:

IntelliSense -- by Rajat (requires XP/2k/NT): This script watches while you edit an AutoHotkey script. When it sees you type a command followed by a comma or space, it displays that command's parameter list to guide you. In addition, you can press Ctrl+F1 (or another hotkey of your choice) to display that command's page in the help file. To dismiss the parameter list, press Escape or Enter.

Thanks.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Thx Chris.

I am currently in process of updating this script, so about the show case, let us delay it for the finall version of the script witch I plan to be language independent ( lets hope I can do that...). I also plan to support AHK functions, user variables etc.....
Posted Image