SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

The popular SciTE-based AutoHotkey Script Editor
StefOnSteroids
Posts: 77
Joined: 08 Aug 2015, 10:22

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

18 Aug 2015, 23:52

Heezea wrote:Currently, the same button performs both commenting and un-commenting
I don't have an answer to your question, but how do you get that button? I want to have it, too.
Heezea
Posts: 59
Joined: 30 Sep 2013, 21:33

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

19 Aug 2015, 07:18

Stef, in the SciTe editor, go to Options > Open user properties, then add the following at the bottom of the user properties file. Then save the user properties and restart the editor.

Code: Select all

KeypadMinus|IDM_BLOCK_COMMENT|\
StefOnSteroids
Posts: 77
Joined: 08 Aug 2015, 10:22

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

19 Aug 2015, 07:54

Thanks Heezea,
I already have that line in my user properties, but under the section

Code: Select all

user.shortcuts=\
At the top of my user properties it says:

Code: Select all

# For Toolbar -> Open User Toolbar properties
But when I add the line in my user toolbar properties, it does not work. There is no "regular" section there it seems, only sections for Tools and Scriptlets.

Are you sure you put your entry into user properties? Not user toolbar properties?
In either case, at what section? What does it say above the line?
Heezea
Posts: 59
Joined: 30 Sep 2013, 21:33

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

19 Aug 2015, 08:37

Stef, I have it in the same place in the user.shortcuts; in the SciTEUser.properties. Also, try using ctrl+q, I think this is the "default" editor key without adjusting the user properties file. Works for me in addition to the NUMPAD minus key.

Code: Select all

#~ ;****************# User defined hot key commands*****#  get others here: http://www.scintilla.org/CommandValues.html 
user.shortcuts=\
KeypadMinus|IDM_BLOCK_COMMENT|\
StefOnSteroids
Posts: 77
Joined: 08 Aug 2015, 10:22

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

19 Aug 2015, 11:02

Wait - I think we might have a misunderstanding here. When you said you had a "button" for it, I assumed you were talking about a toolbar button, to click on it. :think: Not pressing a keyboard key. My question was geared towards getting the TB-button, not the shortcut, that already works over here.

Do you have a toolbar-button?
If not, sorry for hijacking your thread, Heezea. You may want to repeat your original question, so potential helpers will see it again at the bottom and not get the wrong idea because of our button-talk.
User avatar
EatNoMeat
Posts: 13
Joined: 30 Jan 2014, 18:34

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

26 Aug 2015, 07:24

I'm trying to completely disable automatic indenting (ie, every time AciTE4AutoHotkey is opened, indenting is already disabled)

I added the following lines to SciTEUser.properties

Code: Select all

tabsize=0
indent.size=0
use.tabs=0
indent.auto=0
indent.automatic=0
With those lines added, indenting is still enabled and tabsize defaults to 8 even though I set it to 0.
If I set tabsize to 1, it stays at 1 but there's still the issue of indenting remaining enabled.

UPDATE: Setting tabsize to -1 instead of 0 is working well enough, though all I really wanted was for the automatic indenting to be disabled, not the ability to insert tabs altogether.
insteadof
Posts: 1
Joined: 04 Sep 2015, 20:52

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

04 Sep 2015, 20:58

please help me My Scite faulty
please help me fix it
video : https://www.youtube.com/watch?v=oTFTHkg ... e=youtu.be
drposts

SciTEUser.properties for WORDSTAR

06 Sep 2015, 01:56

I prefer to use WORDSTAR navigation keys. (REF: http://www.editpadpro.com/manual/prefsk ... dstar.html)

I use KeyTweak.exe to flip the key assignments for <CapsLock> and <LeftCtrl>. (REF: http://keytweak.en.softonic.com/)

Below is a set of user.shortcuts to implement most of the the WORDSTAR navigation keys. Paste them into your SciTEUser.properties file (open from Options - Open user properties). You must save SciTEUser.properties and then close and re-open SciTE4AutoHotkey to implement the new shortcuts.

Code: Select all

user.shortcuts=\
Ctrl+E|2302|\
Ctrl+T|2336|\
Ctrl+U|2176|\
Ctrl+A|2308|\
Ctrl+S|2304|\
Ctrl+D|2306|\
Ctrl+F|2310|\
Ctrl+G|IDM_CLEAR|\
Ctrl+H|2326|\
Ctrl+X|2300|\
Ctrl+4|IDM_SAVEAS|\
Ctrl+5|2404|\
Ctrl+6|IDM_GOTO|\
Ctrl+7|IDM_FIND|\
Ctrl+8|IDM_REPLACE|\
Ctrl+9|IDM_SELECTALL|\
Ctrl+0|2339|\
WHERE:
ON KEYBOARD UPPER ROW "QWERT"
Ctrl+E|2302| implements moves cursor up 1 row
Ctrl+T|2336| implements deletes right to start of next word
Ctrl+U|2176| implements undo last action
ON KEYBOARD HOME ROW "ASDF"
Ctrl+A|2308| implements move cursor 1 word left (or to end previous line if closer)
Ctrl+S|2304| implements move cursor 1 character left
Ctrl+D|2306| implements move cursor 1 character right
Ctrl+F|2310| implements move cursor 1 word right (or to start next line if closer)
Ctrl+G|IDM_CLEAR| implements deletes character to right of cursor
Ctrl+H|2326| implements deletes back selection (or back 1 character)
ON KEYBOARD LOWER ROW "ZXCV"
Ctrl+X|2300| implements move cursor down 1 row

AND WHERE:
Ctrl+4|IDM_SAVEAS| alternatively implements SciTE4AutoHotkey Ctrl+S file save as
Ctrl+5|2404| alternatively implements SciTE4AutoHotkey Ctrl+D duplicate current line
Ctrl+6|IDM_GOTO| alternatively implements SciTE4AutoHotkey Ctrl+G goto
Ctrl+7|IDM_FIND| alternatively implements SciTE4AutoHotkey Ctrl+F find
Ctrl+8|IDM_REPLACE| alternatively implements SciTE4AutoHotkey Ctrl+H replace
Ctrl+9|IDM_SELECTALL| alternatively implements SciTE4AutoHotkey Ctrl+A select all
Ctrl+0|2339| alternatively implements SciTE4AutoHotkey Ctrl+T trade current and preceding lines

References:
http://www.scintilla.org/SciTEDoc.html user.shortcuts
https://github.com/fincs/SciTE4AutoHotk ... properties
http://www.editpadpro.com/manual/prefsk ... dstar.html)
http://keytweak.en.softonic.com/

I hope this saves some of you some time.
User avatar
WAZAAAAA
Posts: 88
Joined: 13 Jan 2015, 19:48

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

09 Sep 2015, 16:19

GeekDude wrote:@WAZAAAAA

I use the AutoIndent code from AHK Studio. Since AHK Studio is actually written in AHK, it makes it a simple matter to pluck out the indenter.

Here's his original code though it's been updated a bit since I did this, and here's my version of it I use for my code tester:

Code: Select all

AutoIndent(Code, Indent = "`t", Newline = "`r`n")
{
	IndentRegEx =
	( LTrim Join
	Catch|else|for|Finally|if|IfEqual|IfExist|
	IfGreater|IfGreaterOrEqual|IfInString|
	IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|
	IfNotExist|IfNotInString|IfWinActive|IfWinExist|
	IfWinNotActive|IfWinNotExist|Loop|Try|while
	)
	
	; Lock and Block are modified ByRef by Current
	Lock := [], Block := []
	ParentIndent := Braces := 0
	ParentIndentObj := []
	
	for each, Line in StrSplit(Code, "`n", "`r")
	{
		Text := Trim(RegExReplace(Line, "\s;.*")) ; Comment removal
		First := SubStr(Text, 1, 1), Last := SubStr(Text, 0, 1)
		FirstTwo := SubStr(Text, 1, 2)
		
		IsExpCont := (Text ~= "i)^\s*(&&|OR|AND|\.|\,|\|\||:|\?)")
		IndentCheck := (Text ~= "iA)}?\s*\b(" IndentRegEx ")\b")
		
		if (First == "(" && Last != ")")
			Skip := True
		if (Skip)
		{
			if (First == ")")
				Skip := False
			Out .= Newline . RTrim(Line)
			continue
		}
		
		if (FirstTwo == "*/")
			Block := [], ParentIndent := 0
		
		if Block.MinIndex()
			Current := Block, Cur := 1
		else
			Current := Lock, Cur := 0
		
		; Round converts "" to 0
		Braces := Round(Current[Current.MaxIndex()].Braces)
		ParentIndent := Round(ParentIndentObj[Cur])
		
		if (First == "}")
		{
			while ((Found := SubStr(Text, A_Index, 1)) ~= "}|\s")
			{
				if (Found ~= "\s")
					continue
				if (Cur && Current.MaxIndex() <= 1)
					break
				Special := Current.Pop().Ind, Braces--
			}
		}
		
		if (First == "{" && ParentIndent)
			ParentIndent--
		
		Out .= Newline
		Loop, % Special ? Special-1 : Round(Current[Current.MaxIndex()].Ind) + Round(ParentIndent)
			Out .= Indent
		Out .= Trim(Line)
		
		if (FirstTwo == "/*")
		{
			if (!Block.MinIndex())
			{
				Block.Push({ParentIndent: ParentIndent
				, Ind: Round(Lock[Lock.MaxIndex()].Ind) + 1
				, Braces: Round(Lock[Lock.MaxIndex()].Braces) + 1})
			}
			Current := Block, ParentIndent := 0
		}
		
		if (Last == "{")
		{
			Braces++, ParentIndent := (IsExpCont && Last == "{") ? ParentIndent-1 : ParentIndent
			Current.Push({Braces: Braces
			, Ind: ParentIndent + Round(Current[Current.MaxIndex()].ParentIndent) + Braces
			, ParentIndent: ParentIndent + Round(Current[Current.MaxIndex()].ParentIndent)})
			ParentIndent := 0
		}
		
		if ((ParentIndent || IsExpCont || IndentCheck) && (IndentCheck && Last != "{"))
			ParentIndent++
		if (ParentIndent > 0 && !(IsExpCont || IndentCheck))
			ParentIndent := 0
		
		ParentIndentObj[Cur] := ParentIndent
		Special := 0
	}
	
	if Braces
		throw Exception("Segment Open!")
	
	return SubStr(Out, StrLen(Newline)+1)
}
Thanks for mentioning AHK Studio, I was not aware of its existence. Now I'm using its sweet auto indent every time I need to copy and paste a whole script.
YOU'RE NOT ALEXANDER
dsewq1LYJ
Posts: 116
Joined: 26 Aug 2014, 23:21

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

12 Sep 2015, 01:48

WAZAAAAA wrote:Since there's no tool or function available to instantly clean an entire messy AutoHotkey script (at least not anymore, Auto-Syntax-Tidy is outdated), I've decided to make one... more or less.
Basically, this script takes your ugly looking script and manually rewrites it all into SciTE (which will apply a proper syntax/indentation) with SendRaw. Yes, it's THAT cheap... and actually works great, it doesn't even need to be updated haha. In my defense, I've spent a while figuring out that reading a direct file is a better option than dealing with escape characters lol.

INSTRUCTIONS:
1. Disable the auto-complete. This is important, otherwise the script may get corrupted. To disable it, I renamed ahk.api to bla.api and restarted SciTE;
2. Make sure that ugly.ahk (your own script that needs to be cleaned) and the following script (AHK-Cheap-Syntax-Tidy.ahk) are in the same folder;
3. Finally hit F11 while inside SciTE4AutoHotkey to start the rewrite.

Code: Select all

;IMPORTANT: before use, disable SciTE4AutoHotkey's autocomplete
F11::
FileRead, CONTENT, *t ugly.ahk
SendInput {Raw}%CONTENT%
EXAMPLE USAGE:
Image

Shout-outs to joedf for his great "PlasticCodeWrap" theme I used in the GIF (except with black background). Also to Klaus2 for the example script (though I don't actually use it). And obviously fincs.
May you share your colorscheme for everyone : ]

It looks pretty nice.
User avatar
WAZAAAAA
Posts: 88
Joined: 13 Jan 2015, 19:48

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

17 Sep 2015, 21:02

dsewq1LYJ wrote:May you share your colorscheme for everyone : ]

It looks pretty nice.
WAZAAAAA wrote:Shout-outs to joedf for his great "PlasticCodeWrap" theme I used in the GIF (except with black background)
YOU'RE NOT ALEXANDER
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

25 Sep 2015, 03:33

hi, may you know
howTo permanantly disable indenthelp in scite?
Attachments
2015-09-25 10_32_45-window_event_listener.ahk - SciTE4AutoHotkey [4 von 4].png
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

25 Sep 2015, 07:01

#~ Sets the indention of continued wrapped lines to better visually identify the wrapping. Default is 0 (no indention). Note if wrap.visual.flags is 2 or 3 (begin marker displayed) the line is indented at least 1, even if wrap.visual.startindent is still 0.

In your User.properties file try this:
wrap.visual.startindent=0
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

02 Oct 2015, 02:47

solved :)
i set

# view.indentation.guides=1 # thats default
view.indentation.guides=0 :bravo:



###############################
Joe_Glines_Joetazz wrote:#~ Sets the indention of continued wrapped lines to better visually identify the wrapping. Default is 0 (no indention). Note if wrap.visual.flags is 2 or 3 (begin marker displayed) the line is indented at least 1, even if wrap.visual.startindent is still 0.

In your User.properties file try this:
wrap.visual.startindent=0
i tried

wrap.visual.startindent=0

wrap.visual.startindent=9

has no (possitive) effect. nothing is changed.

may there is a way to make the line color black?


Found scite explanation, but not solved my problem. it probably helps explaining the problem:

"SCI_SETINDENTATIONGUIDES(int indentView)
SCI_GETINDENTATIONGUIDES
Indentation guides are dotted vertical lines that appear within indentation white space every indent size columns. They make it easy to see which constructs line up especially when they extend over multiple pages. Style STYLE_INDENTGUIDE (37) is used to specify the foreground and background colour of the indentation guides." http://www.scintilla.org/ScintillaDoc.h ... TIONGUIDES
Attachments
2015-10-02 10_17_55-window_event_listener.ahk - SciTE4AutoHotkey.png
(16.1 KiB) Downloaded 43 times
woshichuanqilz72
Posts: 117
Joined: 05 Oct 2015, 21:23

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

06 Oct 2015, 00:45

I add a keyword into the ahk.api by ahk func 'fileapppend', how can I reload the ahk.api without reboot the SciTE .

I call the com oSciTE.ReloadProps(), and it doesn't work. Look forward to you reply.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

06 Oct 2015, 01:22

I believe the API is loaded each time you switch tabs, therefore you should not need to tell SciTE to reload it. I just confirmed by editing ahk.api, saving and then switching tabs: it took effect immediately.

N.B. You should add API entries to user.ahk.api in the same directory as your SciTEUser.properties, not ahk.api. Changes to this file also take effect immediately upon switching tabs.

Is "fileapppend" actually a function or just a typo of "FileAppend", which is already in ahk.api?
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

06 Oct 2015, 02:49

A question about tillago:
I have this for a test in a script:

Code: Select all

#b:: ; <-- show me this
....
return
When I call in the list I just have #b:: and not #b:: ; <-- show me this
Any way to have the complete line of the hotkey?
DaveT1
Posts: 224
Joined: 07 Oct 2014, 11:23

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

07 Oct 2015, 09:01

Hi,

SciTE4AutoHotkey is tremendous and makes my poor scripting effort much easier - so many thanks fincs. But I have a few questions (please excuse my ignorance as I'm relatively new to all this):

1) Indentation of braces: I like this style:

Code: Select all

	If (ModuleStart = 1)
		{
		StringSplit, OutputArray, A_LoopReadLine, `:
		ModuleString[ModuleNumber,1] := OutputArray1
		}
but by default SciTE4AutoHotkey gives this:

Code: Select all

	If (ModuleStart = 1)
	{
		StringSplit, OutputArray, A_LoopReadLine, `:
		ModuleString[ModuleNumber,1] := OutputArray1
	}
I have a feeling that somewhere in the .properties files I should be able set the indenting of the braces, but I don't know how. Can anyone kindly guide me?

2) When in the debug mode, I find myself nearly always looking at the variable list. So
(a) When I stop debug mode (usually to make further changes to the code) the variable list disappears. On restarting debug mode to test effects of code changes, I need to re-look at the variable list, nearly always having to move the window and re-size some columns. Is there a setting where I can automatically re-start the variable list window each time I enter debug mode? Can get the variable list window to remember it's last location? (I suppose I could address both these points by writing some autohotkey script to do this when clicking the debug icon?).
(b) is it possible to create a user-defined list of variables to watch in the variable list window?

3) Can SciTE4AutoHotkey tell me if I've declared variables which are not then used? (I guess I'm sloppy and quickly create variables to test something, or change my mind about the way I want some code to work and inadvertently leave gash stuff lying around!)

4) And finally....is there anything in SciTE4AutoHotkey, or which could be added to it, to produce a view of the overall program flow? In my mind this would be conceptually like a flow chart, but in text form. And it would chase down gosubs bring the subroutine's flow back to the calling routine.

OK, sorry for the long post - I guess I've been saving those Qs up for a while now. Please excuse if they're daft newbie questions - I'm very happy to be corrected!
User avatar
Learning one
Posts: 173
Joined: 04 Oct 2013, 13:59
Location: Croatia
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

08 Oct 2015, 15:56

I have a strange problem with SciTE4AutoHotkey version 3.0.06.01;
  • when I type ms, ListBox appears and MsgBox item is selected [OK]
  • then I press enter key and MsgBox is written/autocompleted [OK]
  • then I press comma key, and ToolTip appeas which displays command parameters [OK]
  • and imediatelly after that SciTE4AutoHotkey freezes - I don't see comma which I just typed, cursor doesn't blink, I can't see what I'm writing and I can't click in some other line in the script which I'm editing [ERROR]
Image
Anybody had the same problem? How to fix that? :(
I think this problem started to appear after windows update... I'm on Win 7 home premium 64-bit.
User avatar
joedf
Posts: 8951
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

08 Oct 2015, 16:53

just tried it, nothing like that happens to me... :/
Windows 7 Home Premium, Version 6.1 (7601 SP1)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 18 guests