I
I
I_dont_known2016-04-01 14:46:02
Sublime Text
I_dont_known, 2016-04-01 14:46:02

How to convert the entered characters to uppercase in the snippet?

There is a snippet for inserting an include guard (c++).

<snippet>
    <description>Include guard</description>
    <content><![CDATA[#ifndef INCLUDEGUARD_${1}
#define INCLUDEGUARD_${1/(.+)/\U\1/g}

$0

#endif /* #ifndef INCLUDEGUARD_${1/(.+)/\U\1/g} */
]]></content>
    <tabTrigger>iguard</tabTrigger>
    <scope>source.c++, source.objc++</scope>
</snippet>

How can I make the text entered in ${1} also be in uppercase? I tried to add a regular expression, but then it immediately jumps to $0.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Surin, 2016-04-03
@I_dont_known

It looks like there is no way to implement this by standard means. And you are not the first person to face this problem . However, the editor's support is silent on this issue and has been silent for a long time . So I'm afraid you'll have to use caps lock or ctrl+k ctrl+u for now. I noticed that in some cases an auto-complete appears, by choosing which (by pressing Enter) the line takes the form of an uppercase line, but to be honest, I didn’t manage to do something normal with this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question