0

My question is directed related to this question. The difference is that TextMate v.2.0.6 appear to have evolved to the point where answers to that question are not helping.

Question: How to add a file association to an existing bundle?

Specifically, how to add extension ncx to the html bundle. Here's a screenshot of what I've tried. In words:

Menu -> Bundles -> Edit Bundles... -> HTML -> Language Grammars -> HTML -> 'Injection Selector': ncx -> Press '+'.

Instead of adding ncx to the list, a blank is added (see inside the red circle). And files with extension 'ncx' have no syntax highlighted.

Moreover, now file names in the top bar appear as toc.ncx -- ncx or README.md -- ncx, i.e. a mysterious --ncx has now been added at the top of the screenshot (see inside the red circle).

What have I done wrong? Thanks!

enter image description here

PatrickT
  • 103
  • 5

1 Answers1

1

Double click on the empty line to change its value.

IIRC: "Injection Selector" refers to situations like a <script> tag in html, where the html grammar provides a selector, that -when matched- activates the JavaScript syntax.

It occurs to me that, while the above is (hopefully) the answer to your question there may be a better way. Instead of modifying the bundle you could/should use .tm_properties:

#~/.tm_properties
[ *.ncx ]
fileType         = 'text.html.basic'
  • 1
    The bundle editor needs lots of love. – Graham P Heath Jun 02 '20 at 15:28
  • Great answer, thanks! I already have a custom `.tm_properties` file (with not much in it). I'll add these lines to it. I can also confirm that clicking on the white space works as you stated -- not obvious because when you click on `'+'`, the white space is created below the visible area, it becomes visible only when you drag down (because the number of associated file extensions is long enough to fill the small vertical space). – PatrickT Jun 02 '20 at 18:30
  • 1
    Yeah, and then what happens if you add a bunch of empty lines, lol. IIRC its fine, but it'd be an easy mistake to make. FWIW: I'm pretty sure I've asked this question on the mailing list. – Graham P Heath Jun 02 '20 at 22:03