orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
624 stars 38 forks source link

Going for new style snippets, I can't makethem work as per documentation #535

Closed paaguti closed 1 month ago

paaguti commented 1 month ago

HI

last Textadept... I have been off for some time. Tryinh to port my snippets to 12.4 following the documentation about transforms:

Transforms

”${n:/upcase}”, “${n:/downcase}”, and “${n:/capitalize}” sequences, which represent the uppercase, lowercase, and capitalized forms, respectively, of the content of the nth capture. You can define your own transformation function in textadept.snippets.transform_methods.

However, these don't seem to work directly:

image

Could the documentation be updated, please

Thanks a ton, /PA

orbitalquark commented 1 month ago

That section of the documentation is under the "Transforms" section. Your $3 placeholder is not a transform. Something like ${3/.+/${0:/upcase}/} should work. There are a couple of test cases for transformations that you can reference:

Sorry for the trouble, but it looks like these types of snippets have won the snippet syntax war, so we have to go with it.

paaguti commented 1 month ago

OK, but my point is that the doc is somehow misleading ;-)

Maybe if you highlight the following They have the following syntax: “${n/regex/format/options}”. it would be enough. Currently is is quite hidden in the paragraph and it doesn't look as important as the list below, where you have things that look like mirrors etc.