FingerText
FingerText copied to clipboard
triggers must start with a letter?
hi,
do triggers must start with a letter? can that be changed?
I'd like to setup triggers like: "$(" (without the quotes of course) to expand to jquery ready function, or use the open-tag "<" as a prefix for some of the triggers.
This one is interesting.
It's actually super easy to implement more "allowed characters" in TriggerText, but I deliberately avoid them.
The reason is, if I allow for $( to trigger a snippet, that means $ and ( are consider an "allowed character". Then when someone type (var
and hit tab, it won't trigger the snippet var
because Fingertext got a triggertext of (var
instead of var
. Similarly for <.
And there are some other suggestions say I can treat the special characters in a different manner so that it will try to trigger var
in case <var
is not found..........let me see if I can do it without harming the performance a lot.
I do see the benefit of allowing characters like $ ( < [ and @ ........but let me be a little bit cautious about these kind of changes. For now, alphanumerics is recommended for triggertext.
thank you for your prompt response, consideration, and an excellent plugin :)
Do you think it's okay to assume that when a triggertext starts with $(
, it's triggered after a space?
for example if you type
$(abc
and hit tab, it will trigger the snippet $(abc
, but if you type
def.$(abc
and hit tab, it will NOT trigger the snippet $(abc
??
yes, I believe that the $( sign will be after a whitespace character (most likely a TAB, a Space, or a New Line character), the only additional character could be a semi-colon since that is also a valid statement separator for Javascript.
if a user wants to use something like def.$(abc then their trigger text will start with "def"
a similar guideline for the < symbol for a prefix. most likely it will be after a whitespace character or a closing > symbol.
in both cases, if they are only valid after a whitespace character then I, and I believe other users of tag-based (html, xml, coldfusion, etc), will be very happy.
thank you.
Dear erinata, thank you for your great plugin. Is it really a question of performance to search for a matching trigger text in the whole string after the last space? I'm often in the situation that i need to add a trigger right after a preceding string without space, e.g. I have the following snippet with trigger text "a2":
= $[![]!] ?>and I want to add it like this:
Some texta2[tab]
I cannot trigger this, because the trigger text would directly follow the string "text". It would be nice, if you could set a greedy match behaviour like this in the ini file:
while length(trigger)>0 and notfound(trigger) ( trigger = removefirstchar(trigger) )
You can say this it's a performance problem. Or you can say that it's a design problem.
The problem of this greedy match is, EVERYTIME you hit a tab, this greedy match is triggered. And the whole typing experience become quite "sluggish" when I use notepad++ on a netbook. I think notepad++ means to be light weight.
But the previous problem is not the most important problem. Actually greedy match does not encourage "short trigger text". For example if you have triggertext "p" for "
$[![]!]
" , which is very common in html snippets. Greedy match implies that this snippet is triggered every time you enter a tab after a "p", even if you may just want a "tab" to be inserted, or more seriously, I am just navigating between hotspots.I am not saying that it's impossible to make this as an option. I hope that you understand that I do need to consider quite a number of issues before I add that simple while loop.