Make a Bundle available only for a programming language

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Make a Bundle available only for a programming language

Umberto Cerrato
Hello there,

I would like to make my bundle (grammar and theme) to work for C and C++ sources only. How can I achieve it?
This is my actual Grammar configuration, but I would need to restrict the theme to C and C++  too (Since my custom changes are not good for other source files too).

Best


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Make a Bundle available only for a programming language

sellmerfud


On Thu, Oct 3, 2019 at 3:18 AM Umberto Cerrato <[hidden email]> wrote:
Hello there,

I would like to make my bundle (grammar and theme) to work for C and C++ sources only. How can I achieve it?
This is my actual Grammar configuration, but I would need to restrict the theme to C and C++  too (Since my custom changes are not good for other source files too).

Best

In the Grammer field enter: source.c,source.c++
That will restrict your grammer to only those languages.


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate

1.png (42K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Make a Bundle available only for a programming language

Kyle Kirbatski
In reply to this post by Umberto Cerrato
In the Scope Selector text box put:

source.c++,source.c

> On Oct 3, 2019, at 3:18 AM, Umberto Cerrato <[hidden email]> wrote:
>
> Hello there,
>
> I would like to make my bundle (grammar and theme) to work for C and C++ sources only. How can I achieve it?
> This is my actual Grammar configuration, but I would need to restrict the theme to C and C++  too (Since my custom changes are not good for other source files too).
>
> Best
> <1.png>
>
> _______________________________________________
> TextMate mailing list
> [hidden email]
> https://lists.macromates.com/listinfo/textmate


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Make a Bundle available only for a programming language

Umberto Cerrato
Thank you guys,

Eventually this worked for me:
So basically just changing the Injection Selector did the work.

About the theme. I think it is not possible to limit itself to a single source. Anyway it is not a problem since I specifically use it only for C and C++. My main theme is another one.

Thanks

Best,
-u


Il giorno 3 ott 2019, alle ore 17:29, Kyle Kirbatski <[hidden email]> ha scritto:

In the Scope Selector text box put:

source.c++,source.c

On Oct 3, 2019, at 3:18 AM, Umberto Cerrato <[hidden email]> wrote:

Hello there,

I would like to make my bundle (grammar and theme) to work for C and C++ sources only. How can I achieve it?
This is my actual Grammar configuration, but I would need to restrict the theme to C and C++  too (Since my custom changes are not good for other source files too).

Best
<1.png>

_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate



_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Make a Bundle available only for a programming language

Allan Odgaard-4

On 14 Oct 2019, at 10:55, Umberto Cerrato wrote:

e.g. I want C/C++ files to open with this new theme. I can do it in the way you suggested me. And that’s good.
But since this theme works well only with C and C++ files, I do not want it to be available/selectable/take effect if there is an opened file with a different extension than .c or .cpp etc.

What you can do is open the .tmTheme file and insert this under the root <dict> element:

<key>hideFromUser</key>
<true/>

This will cause the theme to be hidden from the View menu, though also for C/C++ files.



_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Make a Bundle available only for a programming language

Umberto Cerrato
Oh man!! That’s neat!!
Thank you very much

> Il giorno 14 ott 2019, alle ore 11:14, Allan Odgaard <[hidden email]> ha scritto:
>
> On 14 Oct 2019, at 10:55, Umberto Cerrato wrote:
>
> e.g. I want C/C++ files to open with this new theme. I can do it in the way you suggested me. And that’s good.
> But since this theme works well only with C and C++ files, I do not want it to be available/selectable/take effect if there is an opened file with a different extension than .c or .cpp etc.
>
> What you can do is open the .tmTheme file and insert this under the root <dict> element:
>
> <key>hideFromUser</key>
> <true/>
>
> This will cause the theme to be hidden from the View menu, though also for C/C++ files.
>
>
> _______________________________________________
> TextMate mailing list
> [hidden email]
> https://lists.macromates.com/listinfo/textmate


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate