lintalist
lintalist copied to clipboard
Shorthand: use Hotstring() to replace Loop + Input
Currently Lintalist uses a "faux" hotstring function by using a Loop + Input.
This should be replaced by the new native https://autohotkey.com/docs/commands/Hotstring.htm function for better reliability.
- https://github.com/lintalist/lintalist/issues/127#issuecomment-496279719
- #143
Is this related to performance contrast between hotstrings and shorthand? Will briefs be faster now?
Yes, using Hotstrings() should improve the overall reliability and possibly offer some speed improvements.
A (experimental!) development branch is available here: https://github.com/lintalist/lintalist/tree/dev-hotstrings
If you try it out please make sure you have a backup of your bundles, they may end up corrupted (shouldn't happen but if you have backups nothing is lost)
I finally got around to trying this, and the performance markedly improved! Very nice.
I've tested the experimental fix, but it happend again. However, it took a good amount of time, compared to the normal 5-30minutes (2-3 hotstrings).
Are there any way to check why it's not listening, like it should? (Debug-log, specific commands, command-lookup, and so on...)
Nope, no debugging available, I tried to add something in the past but as it jumps around all over the script it isn't really feasible (would require a "log" command after nearly every command to pin point a problem). This experiment was a first attempt, the entire shorthand/hotkey routine needs to be redone which would hopefull fix it, if it doesn't it should at least make it a bit easier to bug track where it "stops" :(
Update: After moving the application to another locations, it's more stable with the Hotstring(), so something must be working - And I can't tell if it's a combination, or if it isolated to a single thing. I'll continue to use the experimental version.
Hi,
There's something broken in the latest dev-hotsrings branch. Going from shorthand to key-shotcut works every time, but going from key-shotcut to shorthand doesn't work properly. It's failing to execute the shorthand properly the first time.
Example:
- "test" > Shorthand works
- Ctrl+Alt+b > Key-shortcut works
- "test" > Shorthand doesnt execute properly. But the shorthand text itself, are removed from the editor where I entered "test".
- "test" again > Now it's working again.
Grap the latest dev-hotstrings, and use the following bundle:
BundleFormat: 1
Name: Default
Description: Default bundle for Lintalist
Author: Lintalist
TitleMatch:
Patterns:
- LLPart1: This is Snippet Part 1, refer to documentation for further info.
LLPart2: This is Snippet Part 2
LLKey:
LLShorthand: test
LLScript:
- LLPart1: This is Snippet Part 111, refer to documentation for further info.
LLPart2: This is Snippet Part 222
LLKey: ^!b
LLShorthand:
LLScript:
Or grap my file: lintalist-dev-hotstrings.zip
I really hope you're able to fix this, @lintalist . I'm not that good in the AHK-codebase, so I can't spot what's breaking.
Here's a GIF:

The "Hotstring()" method are way more stable, so it's not an option to go back to the old loop-method. 🦄🌞 🌈
I'm still thinking about it :) one caveat I can't put my finger on is how to deal with duplicate hotstrings that are available in two or more bundles. e.g. /b in HTML and CSS which (titlematch for both: html,css) which at the moment shows a menu "which one to use" - with hotstrings I haven't thought of a way to do that - or I would simply have to accept you can only have one hotstring (it would load only the first one it finds so either always HTML or CCS in the case, would depend on which bundle would be loaded first).
AutoHotkey 2 (beta) is around the corner, so I'm tempted to re-write Lintalist in AutoHotkey v2 getting rid of all the spaghetti code and "dirty hacks" which would make it easier to maintain.
@lintalist - That's fair. But can't we fix the issue, which I just mentioned? I thought that was easy to fix 😊? That would be SO NICE 😅...
Try this (experimental so backup everything) lintalist.zip
Looks OK to me :-) https://www.diffchecker.com/soSDCQF9
I'll give it a try!
Update:
Looks OK in my end. Can OutputDebug be removed? I guess so... So I've just removed these lines.
Do report back if
- it works flawlessly :)
- the wrong snippet is pasted at some point, especially if you can reproduce it
- if snippets go missing or get duplicated somehow
Edit: I think you can still make it trip up after cancelling a plugin (choice, filelist)
Still no issues seen in the latest fix 👍
Hi Lintalist.
Here's another follow up. Everything are working as expected, and we've not seen other issues/bugs in relation to this change. So I guess it's safe to make the chage in the main release.
It stopped working two times in a row today, I don't know why though. There is a certain chain of events that sets or doesn't clear a variable that is used later so it just stops and only a restart fixes it. It can work for days on end and today I did something and it stopped, but I can't pin point it to what "it" is yet. Very annoying.