Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autohotkey hotstring doesn't work with colon

Tags:

autohotkey

doc = Nokogiri::HTML(html.read)

::hotstring:: '< this doesn't work
(
Nokogiri::HTML
)

When I try to make that line as a hotstring in Autohotkey, it does not seem to work. I tested some variations and realized that the colons ::, when included, sort of breaks that hotstring and it doens't work.

How can I make the above code into a working hotstring?

like image 525
1tntla Avatar asked Nov 25 '25 14:11

1tntla


2 Answers

https://autohotkey.com/docs/commands/_EscapeChar.htm says:

`:: (literal pair of colons). In v1.0.40+, it is no longer necessary to escape these.

However, this doesn't really seem to be true: Your hotstringi doesn't work for me either.

Still, if you escape the :: as shown in the link, it'll work for you.

::hotstring::
(
Nokogiri`::HTML
)
like image 192
phil294 Avatar answered Nov 28 '25 16:11

phil294


See "Ending Characters" in the AutoHotkey documentation for Hotstrings.

Unless the asterisk option is in effect, you must type an ending character after a hotstring's abbreviation to trigger it. Ending characters initially consist of the following: -()[]{}':;"/\,.?!`n `t (note that `n is Enter, `t is Tab, and there is a plain space between `n and `t). This set of characters can be changed by editing the following example, which sets the new ending characters for all hotstrings, not just the ones beneath it:

In other words, remove the colon from EndChars like this:

#Hotstring EndChars -()[]{};'"/\,.?!`n `t
like image 25
slackwing Avatar answered Nov 28 '25 16:11

slackwing



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!