v3.1.0
Important note by Lexikos: v3.1.0 defaults to the "Default" platform, which is AutoHotkey v1. If you have only AutoHotkey v2 installed, you will need to install v1 if you want to run v1 scripts, else change to one of the v2 platforms using the platform selector (). Alternatively, you can manually update to the latest SciTE4AutoHotkey program files available at https://github.com/fincs/SciTE4AutoHotkey.
Website
With many thanks to the AutoHotkey Foundation for making this release possible.
Changes and new features:
Dropped support for Windows XP.
Upgraded to SciTE/Scintilla 5.2.2 and Lexilla 5.1.6.
AutoHotkey v1.1.34 syntax definition updates.
AutoHotkey v2.0-beta support, including a completely rewritten new lexer.
Keyword definitions are now almost entirely sourced from the AutoHotkey documentation instead of maintained by hand.
Introduced new SciTE4AutoHotkey style format (s4ahk.style=2). Version 1 styles are automatically converted when edited by the style editor. Older legacy styles are no longer supported.
Introduced new default Light/Dark styles (replacing the previous collection of built-in styles).
The code font is now independently configured and no longer depends on the selected style.
Enhanced the graphical settings and style editors to support more common options.
Merged numerous Debugger improvements and bug-fixes, courtesy of Lexikos.
SciTE4AutoHotkey is now registered as an "Open With" application for .ahk files.
Added Swedish translation (courtesy of Mikael Hiort).
Added Korean translation (courtesy of joyfuI).
Added mechanism for disabling global Toolbar buttons.
Added support for passing parameters to debugged scripts.
Known issues:
Calltip functionality has been temporarily removed as a side effect of the new syntax definition autogeneration, as well as SciTE limitations.
Help file word lookup is currently broken as a result of (not so) recent changes in AutoHotkey's CHM file.
Debugging AutoHotkey v2 scripts is known to sometimes produce crashes under certain circumstances.
AutoHotkey v2 AutoIndent only works when control flow statements are typed in lowercase.
Bug-fixes:
The auto-updater now behaves properly if the update server is down instead of behaving erratically.
Many other miscellaneous fixes, optimizations, code modernisation and cleanup.
SciTE4AutoHotkey v3.1.0
SciTE4AutoHotkey v3.1.0
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 -[My project list]
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 -
Re: SciTE4AutoHotkey v3.1.0
@fincs, Thank you for your excellent editor and for the upgrade. Unfortunately, I am not able to install it. See the image below.
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Re: SciTE4AutoHotkey v3.1.0
SmartScreen acting up on a brand new file, that's normal. Right click on the file, select Properties, tick "Unblock", and click OK.
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 -[My project list]
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 -
Re: SciTE4AutoHotkey v3.1.0
@fincs, Thank you. That worked and I was able to complete the installation. When I opened SciTE4AutoHotkey I saw the following error in the Output window:
Here's the version of @lexikos's AutoComplete.lua that I have in my SciTE folder:
Line 81 refers to this:
Any help to resolve that error would be appreciated.
Code: Select all
...\Documents\AutoHotkey\SciTE/AutoComplete.lua:81: invalid escape sequence near '"[\('
>Lua: error occurred while running startup script
Code: Select all
-- AutoComplete v0.8 by Lexikos (https://gist.github.com/Lexikos/bc17b8d55ae8a8102e35)
--[[
Tested on SciTE4AutoHotkey 3.0.06.01; may also work on SciTE 3.1.0 or later.
To use this script with SciTE4AutoHotkey:
- Place this file in your SciTE user settings folder.
- Add the following to UserLuaScript.lua:
dofile(props['SciteUserHome'].."/AutoComplete.lua")
- Restart SciTE.
]]
-- List of styles per lexer that autocomplete should not occur within.
local IGNORE_STYLES = { -- Should include comments, strings and errors.
[SCLEX_AHK1] = {1,2,3,6,20},
[SCLEX_AHK2] = {1,2,3,5,15},
[SCLEX_LUA] = {1,2,3,6,7,8,12}
}
local INCREMENTAL = true
-- local IGNORE_CASE = true
local IGNORE_CASE = false
local CASE_CORRECT = true
local CASE_CORRECT_INSTANT = false
local WRAP_ARROW_KEYS = false
local CHOOSE_SINGLE = props["autocomplete.choose.single"]
-- Number of chars to type before the autocomplete list appears:
local MIN_PREFIX_LEN = 2
-- Length of shortest word to add to the autocomplete list:
local MIN_IDENTIFIER_LEN = 2
-- List of regex patterns for finding suggestions for the autocomplete menu:
local IDENTIFIER_PATTERNS = {"[a-z_][a-z_0-9]+"}
-- Override settings that interfere with this script:
props["autocomplete.ahk1.start.characters"] = ""
props["autocomplete.ahk2.start.characters"] = ""
-- This feature is very awkward when combined with automatic popups:
props["autocomplete.choose.single"] = "0"
local names = {}
local notempty = next
local shouldIgnorePos -- init'd by buildNames().
local normalize
if IGNORE_CASE then
normalize = string.upper
else
normalize = function(word) return word end
end
local function setLexerSpecificStuff()
-- Disable collection of words in comments, strings, etc.
-- Also disables autocomplete popups while typing there.
if IGNORE_STYLES[editor.Lexer] then
-- Define a function for calling later:
shouldIgnorePos = function(pos)
return isInTable(IGNORE_STYLES[editor.Lexer], editor.StyleAt[pos])
end
else
-- Optional: Disable autocomplete popups for unknown lexers.
shouldIgnorePos = function(pos) return true end
end
end
local apiCache = {} -- Names from api files, stored by lexer name.
local function getApiNames()
local lexer = editor.LexerLanguage
if apiCache[lexer] then
return apiCache[lexer]
end
local apiNames = {}
local apiFiles = props["APIPath"] or ""
apiFiles:gsub("[^;]+", function(apiFile) -- For each in ;-delimited list.
for name in io.lines(apiFile) do
name = name:gsub("[\(, ].*", "") -- Discard parameters/comments.
if string.len(name) > 0 then
apiNames[name] = true
end
end
return ""
end)
apiCache[lexer] = apiNames -- Even if it's empty.
return apiNames
end
local function buildNames()
setLexerSpecificStuff()
-- Reset our array of names.
names = {}
-- Collect all words matching the given patterns.
local unique = {}
for i, pattern in ipairs(IDENTIFIER_PATTERNS) do
local startPos, endPos
endPos = 0
while true do
startPos, endPos = editor:findtext(pattern, SCFIND_REGEXP, endPos + 1)
if not startPos then
break
end
if not shouldIgnorePos(startPos) then
if endPos-startPos+1 >= MIN_IDENTIFIER_LEN then
-- Create one key-value pair per unique word:
local name = editor:textrange(startPos, endPos)
unique[normalize(name)] = name
end
end
end
end
-- Build an ordered array from the table of names.
for name in pairs(getApiNames()) do
-- This also "case-corrects"; e.g. "gui" -> "Gui".
unique[normalize(name)] = name
end
for _,name in pairs(unique) do
table.insert(names, name)
end
table.sort(names, function(a,b) return normalize(a) < normalize(b) end)
buffer.namesForAutoComplete = names -- Cache it for OnSwitchFile.
end
local lastAutoCItem = 0 -- Used by handleKey().
local menuItems
local function handleChar(char, calledByHotkey)
local pos = editor.CurrentPos
local startPos = editor:WordStartPosition(pos, true)
local len = pos - startPos
if not INCREMENTAL and editor:AutoCActive() then
-- Nothing to do.
return
end
if len < MIN_PREFIX_LEN then
if editor:AutoCActive() then
if len == 0 then
-- Happens sometimes after typing ")".
editor:AutoCCancel()
return
end
-- Otherwise, autocomplete is already showing so may as well
-- keep it updated even though len < MIN_PREFIX_LEN.
else
if char then
-- Not enough text to trigger autocomplete, so return.
return
end
-- Otherwise, we were called explicitly without a param.
end
end
if not editor:AutoCActive() and shouldIgnorePos(startPos) and not calledByHotkey then
-- User is typing in a comment or string, so don't automatically
-- pop up the auto-complete window.
return
end
local prefix = normalize(editor:textrange(startPos, pos))
menuItems = {}
for i, name in ipairs(names) do
local s = normalize(string.sub(name, 1, len))
if s >= prefix then
if s == prefix then
table.insert(menuItems, name)
else
break -- There will be no more matches.
end
end
end
if notempty(menuItems) then
-- Show or update the auto-complete list.
local list = table.concat(menuItems, "\1")
editor.AutoCIgnoreCase = IGNORE_CASE
editor.AutoCCaseInsensitiveBehaviour = 1 -- Do NOT pre-select a case-sensitive match
editor.AutoCSeparator = 1
editor.AutoCMaxHeight = 10
editor:AutoCShow(len, list)
-- Check if we should auto-auto-complete.
if normalize(menuItems[1]) == prefix and not calledByHotkey then
-- User has completely typed the only item, so cancel.
if CASE_CORRECT then
if CASE_CORRECT_INSTANT or #menuItems == 1 then
-- Make sure the correct item is selected.
editor:AutoCShow(len, menuItems[1])
editor:AutoCComplete()
end
if #menuItems > 1 then
editor:AutoCShow(len, list)
end
end
if #menuItems == 1 then
editor:AutoCCancel()
return
end
end
lastAutoCItem = #menuItems - 1
if lastAutoCItem == 0 and calledByHotkey and CHOOSE_SINGLE then
editor:AutoCComplete()
end
else
-- No relevant items.
if editor:AutoCActive() then
editor:AutoCCancel()
end
end
end
local function handleKey(key, shift, ctrl, alt)
if key == 0x20 and ctrl and not (shift or alt) then -- ^Space
handleChar(nil, true)
return true
end
if alt or not editor:AutoCActive() then return end
if key == 0x8 then -- VK_BACK
if not ctrl then
-- Need to handle it here rather than relying on the default
-- processing, which would occur after handleChar() returns:
editor:DeleteBack()
handleChar()
return true
end
elseif key == 0x25 then -- VK_LEFT
if not shift then
if ctrl then
editor:WordLeft() -- See VK_BACK for comments.
else
editor:CharLeft() -- See VK_BACK for comments.
end
handleChar()
return true
end
elseif key == 0x26 then -- VK_UP
if editor.AutoCCurrent == 0 then
-- User pressed UP when already at the top of the list.
if WRAP_ARROW_KEYS then
-- Select the last item.
editor:AutoCSelect(menuItems[#menuItems])
return true
end
-- Cancel the list and let the caret move up.
editor:AutoCCancel()
end
elseif key == 0x28 then -- VK_DOWN
if editor.AutoCCurrent == lastAutoCItem then
-- User pressed DOWN when already at the bottom of the list.
if WRAP_ARROW_KEYS then
-- Select the first item.
editor:AutoCSelect(menuItems[1])
return true
end
-- Cancel the list and let the caret move down.
editor:AutoCCancel()
end
elseif key == 0x5A and ctrl then -- ^z
editor:AutoCCancel()
end
end
-- Event handlers
local events = {
OnChar = handleChar,
OnKey = handleKey,
OnSave = buildNames,
OnSwitchFile = function()
-- Use this file's cached list if possible:
names = buffer.namesForAutoComplete
if not names then
-- Otherwise, build a new list.
buildNames()
else
setLexerSpecificStuff()
end
end,
OnOpen = function()
-- Ensure the document is styled first, so we can filter out
-- words in comments and strings.
editor:Colourise(0, editor.Length)
-- Then do the real work.
buildNames()
end
}
-- Add event handlers in a cooperative fashion:
for evt, func in pairs(events) do
local oldfunc = _G[evt]
if oldfunc then
_G[evt] = function(...) return func(...) or oldfunc(...) end
else
_G[evt] = func
end
end
Code: Select all
name = name:gsub("[\(, ].*", "") -- Discard parameters/comments.
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Re: SciTE4AutoHotkey v3.1.0
@fincs, Never mind. I see you have a perfectly good AutoComplete feature in your latest version.
I removed the UserLuaScript.lua and AutoComplete.lua files from my SciTE folder and restarted with no error.
P.S.: Lexicos' AutoComplete auto-completes any word, e.g. variables, while the built-in AutoComplete only auto-completes commands.
I removed the UserLuaScript.lua and AutoComplete.lua files from my SciTE folder and restarted with no error.
P.S.: Lexicos' AutoComplete auto-completes any word, e.g. variables, while the built-in AutoComplete only auto-completes commands.
Last edited by iPhilip on 15 May 2022, 20:37, edited 1 time in total.
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Re: SciTE4AutoHotkey v3.1.0
I am so glad to see this update after so long!
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]
Re: SciTE4AutoHotkey v3.1.0
cool!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Re: SciTE4AutoHotkey v3.1.0
So others don't need to go digging into the source code to find it, I'll point out...
To disable the toolbar buttons which are defined in the global toolbar.properties file, add a file named $NODEFTOOLBAR to the directory containing your SciTEUser.properties (normally %A_MyDocuments%\AutoHotkey\SciTE).
Maybe this should be mentioned in the global toolbar.properties, under where it says "Do NOT edit this file"?
-
- Posts: 6
- Joined: 18 Jul 2016, 16:41
Re: SciTE4AutoHotkey v3.1.0
I have been using SciTE4AutoHotkey for a few years now and really love it. I just updated to v3.1.0 and I am having an issue. The autocomplete for single words (like ControlClick, Loop, etc.) is working great. However, when I type the comma after the command, nothing pops up as it used to to suggest the syntax for the command (ex. ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]). Unfortunately, I'm not too familiar with changing settings and such in the program, so this may be something simple.
Re: SciTE4AutoHotkey v3.1.0
same issue here, had to go back to the older version...workingclay wrote: ↑17 May 2022, 16:19I have been using SciTE4AutoHotkey for a few years now and really love it. I just updated to v3.1.0 and I am having an issue. The autocomplete for single words (like ControlClick, Loop, etc.) is working great. However, when I type the comma after the command, nothing pops up as it used to to suggest the syntax for the command (ex. ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]). Unfortunately, I'm not too familiar with changing settings and such in the program, so this may be something simple.
Re: SciTE4AutoHotkey v3.1.0
Afaics, it is mentioned in the OP:
Known issues:
Calltip functionality has been temporarily removed as a side effect of the new syntax definition autogeneration, as well as SciTE limitations.
Re: SciTE4AutoHotkey v3.1.0
Dear Fincs! You are a big and amateur fan of AHK! So far I have been using SciTEAHK with a dark background, but since installing SciTE4AutoHotkey Version 3.1.00 (May 18, 2022), the style settings do not work. Lest at least I can't darken the background.
I'm not an experienced programmer and a forumer, could I have messed up something during the installation? Is there a solution for this?
(Win10 op. System)
Thank you in advance for your help: Csaba, Veszprém
(Anyway, what programming language do we use in AHK?)
I'm not an experienced programmer and a forumer, could I have messed up something during the installation? Is there a solution for this?
(Win10 op. System)
Thank you in advance for your help: Csaba, Veszprém
(Anyway, what programming language do we use in AHK?)
- Attachments
-
- AHK-StyleBox.png (13.58 KiB) Viewed 13792 times
-
- Posts: 84
- Joined: 06 Oct 2016, 15:57
Re: SciTE4AutoHotkey v3.1.0
Think I found another bug that was introduced with the update. I cannot set break points for the debugger with this update. Had a friend try as well and he was unable to set them either.
Re: SciTE4AutoHotkey v3.1.0
Thanks @fincs for this great upgrade!
I'm having an issue with the use.tabs option (menu "Options, Change Indentation Settings"). I'm trying to keep this option off as it was with my previous version of Scite4AutoHotkey. I added "use.tabs=0" in SciTEUser.properties and reloaded. But the option always shows up enabled when I'm in *.ahk files (not in other types of files). I can't find in global or user properties files where this option would be configured depending on the file types.
The issue for me is that as soon as I save an AHK source file, all spaces are converted to tabs (even if I did not click the "Convert" button) and this would make a huge "difference" if I was to commit this file to my GIT repo.
Thanks for your help.
I'm having an issue with the use.tabs option (menu "Options, Change Indentation Settings"). I'm trying to keep this option off as it was with my previous version of Scite4AutoHotkey. I added "use.tabs=0" in SciTEUser.properties and reloaded. But the option always shows up enabled when I'm in *.ahk files (not in other types of files). I can't find in global or user properties files where this option would be configured depending on the file types.
The issue for me is that as soon as I save an AHK source file, all spaces are converted to tabs (even if I did not click the "Convert" button) and this would make a huge "difference" if I was to commit this file to my GIT repo.
Thanks for your help.
Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Re: SciTE4AutoHotkey v3.1.0
Good point. I should probably also add it to the "toolbar" section of the documentation...lexikos wrote:Maybe this should be mentioned in the global toolbar.properties, under where it says "Do NOT edit this file"?
The easiest way to recover from unreliable settings is to rename or delete the %A_MyDocuments%\AutoHotkey\SciTE folder and start S4AHK again. This will apply a fresh new user profile. You can use the built-in Dark style too. (Don't forget to hit the "Update" button!)babaviz wrote:Dear Fincs! You are a big and amateur fan of AHK! So far I have been using SciTEAHK with a dark background, but since installing SciTE4AutoHotkey Version 3.1.00 (May 18, 2022), the style settings do not work. Lest at least I can't darken the background.
I'm not an experienced programmer and a forumer, could I have messed up something during the installation? Is there a solution for this?
Uhh... AutoHotkey? Unless you're talking about AutoHotkey-jk, which uses JavaScript.babaviz wrote:(Anyway, what programming language do we use in AHK?)
I cannot reproduce this, breakpoints do work. Keep in mind S4AHK v3.1.0 has integrated lexikos' debugger improvement changes, and behaviour has slightly changed from the previous version of S4AHK. Can you provide a minimal test case?ShatterCoder wrote:Think I found another bug that was introduced with the update. I cannot set break points for the debugger with this update. Had a friend try as well and he was unable to set them either.
In theory SciTE should be able to automatically detect the file's indentation settings. If you want to force your preference, add indent.auto=0 to your user properties. It's also entirely possible that SciTE upstream has changed in behaviour.JnLlnd wrote:I'm having an issue with the use.tabs option
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 -[My project list]
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 -
Re: SciTE4AutoHotkey v3.1.0
Adding indent.auto=0 to the user properties fixed the "Use Tabs" checkbox issue. Thanks.
This being solved, I was still having an issue of multiple differences in the file. Investigating a bit deeper, I found that SciTE was automatically removing spaces at the end of lines. This is what was causing the multiple changes in the Diff tool. Adding strip.trailing.spaces=0 to the user properties file fixed the issue. Now, SciTE4AutoHotkey behaves as it was before, at least regarding automatic changes to the files.
I think that this option strip.trailing.spaces=1 is interesting if you always used it in your file. But changing this is all at once in a pretty big file which has grown for almost ten years is not a good idea for a Diff tool :-)
Back to my first post, I guess the use.tabs=0 and indent.auto=0 had nothing to do with that issue. I'll try changing them again to see what I prefer.
Thanks for your input.
Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Now working on Quick Clipboard Editor
The Automator's Courses on AutoHotkey
Re: SciTE4AutoHotkey v3.1.0
It also happened to me in the ZIP version, but I closed the application and when I started it again it workedShatterCoder wrote: ↑18 May 2022, 10:14Think I found another bug that was introduced with the update. I cannot set break points for the debugger with this update. Had a friend try as well and he was unable to set them either.
Thanks @fincs for this great work
Donec Perficiam
-
- Posts: 84
- Joined: 06 Oct 2016, 15:57
Re: SciTE4AutoHotkey v3.1.0
Confirmed. No idea why I was initially unable to set the break points, but closing the app and re-opening did indeed resolve the issue. Thanks again for taking up this project again. Been using scite4autohotkey for something like 5 years now on a nearly daily basis and I appreciate your efforts.jmeneses wrote: ↑19 May 2022, 02:07It also happened to me in the ZIP version, but I closed the application and when I started it again it workedShatterCoder wrote: ↑18 May 2022, 10:14Think I found another bug that was introduced with the update. I cannot set break points for the debugger with this update. Had a friend try as well and he was unable to set them either.
Thanks @fincs for this great work
Re: SciTE4AutoHotkey v3.1.0
hy fincs,
thank you for the new version.
But now my syntax highlightning doesnt work any longer. At the first install I had to permit the antivir to install. I also reinstalled, the antivir didnt ask any longer. but the syntax hightlighting ist gonge, even when I install the version from 2014.
In Scite4AHK I am not able to choose a language. I go on AHK, but there isnt a hook in front of autohotkey after that.
Do you know how I possibly could fix this?
Thank you!
thank you for the new version.
But now my syntax highlightning doesnt work any longer. At the first install I had to permit the antivir to install. I also reinstalled, the antivir didnt ask any longer. but the syntax hightlighting ist gonge, even when I install the version from 2014.
In Scite4AHK I am not able to choose a language. I go on AHK, but there isnt a hook in front of autohotkey after that.
Do you know how I possibly could fix this?
Thank you!
Re: SciTE4AutoHotkey v3.1.0
I have a persistent script which once an hour runs another script. With this new version, SciTE activates once an hour. It also opens the other script if it isn't already open. Has anyone run into this? If so, what have you done to disable this behavior? Thanks.
Who is online
Users browsing this forum: No registered users and 3 guests