Hotstrings option for requiring a preceding alphanumeric

Propose new features and changes
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Hotstrings option for requiring a preceding alphanumeric

27 Jan 2018, 01:37

I just ran into an issue with a weird hotstring, where I could not think of a workaround. I think it could be better handled wiħ native support by hotstrings options.

Code: Select all

:cz?*: t:: t
:cz?*: T:: T
:c?*:th::ħ
The intention is that for any instance of th, except at the beginning of the word, it would be written as ħ. I opted for this because you can easily read the word as if it was properly written if the ħ is in the middle of it, but it ħrows you off a bit if it's not. So I defined that a space followed by a t would get auto-replaced to itself; I had to do boħ lowercase and capital to get the correct auto-replacement values.

My idea would be an option that requires the preceding character before the first letter of the hotstring not be an alphanumerical character-- a different form of the ? option. Instead of ? making it all-inclusive in triggering regardless of the preceding character, and ?0 returning to requiring a non-alphanumerical proceed it, something like ?1 would require an alphanumerical proceed it.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Hotstrings option for requiring a preceding alphanumeric

27 Jan 2018, 21:30

Is this what you wanted?

Code: Select all

:c*B0:th::  ; Don't delete it.
return  ; Do nothing.
:c*?:th::ħ

Code: Select all

:c* :th::th  ; Replace "th" at the start of a word with itself.
:c*?:th::ħ  ; Replace "th" anywhere else ...
FYI, "proceed" and "precede" aren't the same thing, and are kind of opposite. I'm fairly certain you mean the latter. To "proceed" is to move forward, but to "precede" is to come before...
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Hotstrings option for requiring a preceding alphanumeric

27 Jan 2018, 23:26

Even better thinking. I at least tried the first suggestion; your solution was far better than I could come up with evidently; I limited myself to autoreplace strings and tried to make single-case exceptions like a th. Ah well, embarrassing on my part for finding one convoluted workaround which I recognized as non-ideal and thinking it was still the best we had.

Maybe the suggestion still has merit, but with your fairly simple approach and the likely unusual use case for wanting to only ever auto-replace mid-word, I don't see the need to bother with implementation.

I do mean precede. But maybe there was a particular spot in my post where I mixed up the usage.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 16 guests