AutoHotkey v2 alpha (UPDATES)

Discuss the future of the AutoHotkey language
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


24 Jan 2018, 05:35


Fixed methods [broken by v2.0-a085].
Changed `::: in a hotstring to escape only one colon, not two.
Changed hotstrings to split at the first ::, not the last. Note that with an odd number of consecutive colons, the previous behaviour did not consider the final colon as part of a pair. For example, ::1:::a included colon in the replacement while ::2::::b included double-colon in the trigger.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


27 Jan 2018, 21:20

Changes to ([{ continuation:

Fixed detection of missing close-quote in continuation expressions.
Fixed comment sections and line continuation in or following ([{ continuation.
Fixed ([{ continuation for hotkeys with same-line action.
Fixed ([{ continuation for #If.

Changed ([{ continuation to allow continuation sections. The original intention was consistency between ( and [/{, but it didn't work out since continuation sections are handled before ([{ continuation (so were already "permitted" up to the first ([{-unbalanced line).

Improved detection of OTB vs. {} line continuation. It should now be smart enough to allow line continuation wherever an object literal is valid but OTB is not (except for While/If {, which are [still] treated as errors due to the missing parameter).

Other changes:

Improved continuation sections to automatically escape quotes if the continuation section is inside a quoted string, and not escape them otherwise. Removed the Quotes option.

Changed continuation sections to add space if first line ends with word.

Revised handling of xxx() where xxx is a control flow statement name.
  • All control flow statements allow () around their parameter list.
  • If at the start of a line, it is never a function call/definition.
Removed #IfWin and optimized #If Win().

Other bug fixes:

Fixed directives to not permit a comma after the directive name. The comma was treated as part of the parameter's value in most cases.
Fixed quotes being put around vars in ListLines/error text.
Fixed Hotkey() to throw correctly when it fails.
Fixed Hotkey() to allow Label to be omitted.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


29 Jan 2018, 02:41

Fixed else{, try{ and finally{.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


18 Feb 2018, 06:02

Fixed WinGetClientPos to return size, not bottom-right position.
Fixed unary operators following an empty parameter.
Merged v1.1.28.00.
Made A_ListLines writable.
Fixed properties like "x{" and "xx{" in class definitions.
Changed stdin (*) scripts to not prepend working dir to title or A_ScriptFullPath.
Changed threads to execute minimum one line before first interruption.
Changed default thread uninterruptibility to 17ms. Anything less can be virtually no time at all since GetTickCount() has a granularity of 15 or 16.
Removed Suspend("Permit") and added #SuspendExempt.
Removed obsolete checks for action type of thread's first line.
Fixed some issues with #If [broken by v2.0-a087].
Changed remapping to release mandatory modifiers, such as for ^a::b.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


26 Mar 2018, 05:25

Added nested functions, closures and fat arrow => functions.

Renamed RegisterCallback to CallbackCreate and changed to better utilize closures:
  • Added support for function objects.
  • Removed EventInfo parameter (use a closure or bound function instead).
  • Removed the special behaviour of variadic callback functions and added the & option (pass the address of the parameter list).
  • Added CallbackFree(Address), to free the callback memory and release the associated function object.
Changed IsFunc() and Func() to require a function name. Passing an object is now an error.

It is no longer possible to externally call a subroutine inside a function (local label). Nested functions provide the same benefits without the limitations. Specifically:
  • Changed SetTimer and Menu.Add to use only functions/objects, not labels.
  • Changed Hotkey and Hotstring to ignore local labels.
Improved handling of trailing blank parameters.

Optimized Func("LiteralName") to resolve the function name at load time (only applies to direct calls with a single plain quoted string).

Fixed the new Hotstring() function.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


30 Mar 2018, 23:30

Added the capability to name fat arrow functions. This also fixes crashes caused by previously invalid code like MsgBox() => expr.

Fixed => on a line following a label/hotkey/hotstring.
Fixed multi-level upvars (locals from outer-outer function).
Fixed := operator within a fat arrow function.
Fixed => in static class var initializers to not have an implicit this parameter.
Fixed => below if/else/loop/try/etc. to work without a block.
Debugger: Fixed stepping over return after a nested function.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


31 Mar 2018, 23:36

Fixed Hotkey("If", "Expression") [broken by 3e8c8e41 and f9822637].
Fixed Menu objects not being deleted automatically.
Fixed () => breaking the preceding func/var ref [broken by 94d7f6a9].
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


07 Apr 2018, 04:06

Fixed some issues with Menu object cleanup.

Replaced Menu.Standard with Menu.AddStandard().
  • Add normal menu items, which can be modified.
  • Don't create/destroy the menu to add the items.
Revised menu bar handling; added MenuBar type and MenuBarCreate().
  • Report errors (menu bar used as menu or vice versa).
  • Destroy only the menu itself when its object is deleted.
  • Change/remove submenu without destroying the old submenu.
Renamed Gui.Menu to Gui.MenuBar.

Changed &address-of to work with literal and temporary strings.
Changed Object.GetAddress(k) to allow Object[k] to be "".
Changed Object.GetAddress(k) to throw if no string is present.
Changed SendMessage/PostMessage to accept only integers.

Changed () => to be assume-global if not used inside a function.

Changed Gui object to be deleted automatically if not visible.
  • Don't count the program's internal reference to the object.
  • Destroy() when deleted.
  • AddRef() when shown with Show().
  • Release() when hidden with Show/Hide/Cancel/Submit() or by closing.
Merged v1.1.28.02.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


22 Apr 2018, 05:42

Improved error reporting for unbalanced ()/[]/{}.
Fixed detection of invalid v1 legacy assignments.
Fixed Func/DllCall optimization and OutputVar detection with ternary and short-circuit operators.
Split "Unknown property or method" into two messages.
Fixed return string_var optimization for vars which are upvars/downvars.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


29 Apr 2018, 05:25

Fixed Gui.MenuBar return value (previously not implemented).
Changed objects to use 64-bit integer keys on all builds.
Implemented some trivial optimizations to string key lookup and linear array indexing in objects.
Fixed () => x ? y := v : z.
Removed UseErrorLevel from Run/RunWait.
Changed Run/RunWait to always set A_LastError.
Converted RunWait, ClipWait, KeyWait and WinWait' to functions.
  • Never set ErrorLevel.
  • Return non-zero if condition was met (zero for timeout).
  • RunWait: return exit code.
  • WinWaitClose: set Last Found Window.
Changed math functions and operators to throw an exception instead of returning "" for errors.
Added type-conversion functions Float, Integer and String.
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


07 May 2018, 06:25

Changed properties to handle only get/set, not call.
Fixed obj[-n].
Merge pull request #98 from nnnik/AutoHotkey_L
Divided [members of File object] into methods and properties and added errors
-Made `Seek`, `Tell` and `Close` methods
-Unkown Method Error when trying to call a property
-Too few/Too many parameters when calling a method with too few or too many parameters
-Invalid Use Error when trying to set a read only property
Removed File.Tell().
Replaced SendRaw/ControlSendRaw with SendText/ControlSendText.
Changed hotstrings with continuation sections to use {Text} vs. {Raw}.
Changed x.y(z) := v to be an error, not equivalent to x.y[z] := v.
Trivial maintenance (DllCall).
Posts: 5942
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


12 Jun 2018, 22:34

Changed ImageSearch to throw instead of setting ErrorLevel:=2.
Fixed validation of output vars preceded by another parameter.
Added runtime validation of output vars for built-in functions.
Fixed localization of for-loop variables which are aliases (ByRef, free variables in closures, and super-global variables where referenced by a function preceding the declaration).
Merged v1.1.29.01.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 4 guests