.tab files are opening as toml files. How do I fix this?
-
Whenever I open a x.tab file - tab-delimited text file, npp is opening it with a language of TOML and marks it in awful orange and yellow. I have to manually set it back to Normal Text before I can do anything with it.
I’m looking at the Style Configurator and the TOML doesn’t have any extension on it except “toml” as the default.
What do I need to do to have .tab files open as normal text? -
Weird. When I open a file called
blah.tab
, it shows up as “extended crontab file” (Lanugage > N > nncrontab), because nncrontab does havetab
in its default extension list (as seen in Style Configurator).If I edit
%AppData%\Notepad++\langs.xml
and removetab
from thenncrontab
default extension list, save, then exit Notepad++ completely, when I re-run Notepad++ and load ablah.tab
, it is recognized as plain text rather than nncrontab. (If you leftblah.tab
open, it would have remembered the old filetype; but if you close it then re-open it, it should come in as the new filetype.) -
@Chris-Denby like @PeterJones, I have
tab
listed in thenncrontab
language. If his suggestion of removing that extension doesn’t help, maybe try addingtab
to theext
list fornormal
- it should be the first language inlangs.model.xml
. -
@mathlete2 Ok - I’ve done both - removed it from nncrontab and added it to normal and it’s working.
Thanks. -
maybe try adding
tab
to theext
list fornormal
That doesn’t work. It was really easy to try; I understand that there are some things that are complicated, and so you have to give your “best guess” (I do that often, here, with some people’s problems); but this one would only take 2 minutes to test – and, in fact, I did spend that 2 minutes, and was able to verify it didn’t work before making my suggestion; thus, I didn’t mention it, because it didn’t work.
update: because of the post queue, I hadn’t noticed yet that Chris had replied… so the second half of my post (below) came too late… but fortunately, it doesn’t seem to have been necessary.
While you are following my advice (removing
tab
fromnncrontab
), you can also do a regular-expression search forext="[^"]*\btab\b[^"]*"
, which will find iftab
is included in any other language’s default extensions, not just nncrontab; you should remove it from there, as well. And you can actually do the same search in%AppData%\Notepad++\stylers.xml
(or...\themes\NAMEOFTHEME.xml
if you use a different theme), to see whether you havetab
in one (or more) of your “User ext.” lists. -
@PeterJones said in .tab files are opening as toml files. How do I fix this?:
I did spend that 2 minutes, and was able to verify it didn’t work before making my suggestion; thus, I didn’t mention it, because it didn’t work
Thanks for the additional insight, but just to clarify the purpose of my suggestion: it was intended to be a “next step” suggestion if, for some reason, your suggestion didn’t work on his setup like it did for yours. The fact that your setup was picking up a different language to begin with is proof that things are working differently in the two setups, so there’s a chance that your original suggestion would work differently in those setups too. By extension, there’s a chance that my suggestion would work differently on @Chris-Denby 's setup than it did on yours.
-
@Chris-Denby glad that your issue is resolved!
In case you’re still interested in why TOML was being selected in the first place, it might be worth pointing out that @PeterJones and I actually referenced two different language files:
%AppData%\Notepad++\langs.xml
and<NP++_root>\langs.model.xml
. Both of these files seem to have the same coding structure, so one of them might have a different TOML configuration than what you originally reported. -
@mathlete2 said in .tab files are opening as toml files. How do I fix this?:
I actually referenced two different language files:
%AppData%\Notepad++\langs.xml
and<NP++_root>\langs.model.xml
I didn’t notice that you said the model version, otherwise I would have correct that earlier, as well.
Since you apparently don’t know the difference between them (despite the fact that it’s explained in the Manual): the
.model.
version is only used for populating a newlangs.xml
– If Notepad++ sees that there is nolangs.xml
, then it will copylangs.model.xml
tolangs.xml
. But if you already havelangs.xml
, then editinglangs.model.xml
will do nothing for you (unless or until you also delete your activelangs.xml
). -
@PeterJones not a big deal, but a more accurate quote of my reply would have been “[we] actually referenced…”. I understand where the inadvertent mistake was made, but technically, the current quote implies that I was claiming to have referenced two different files within my responses (specifically, the ones prior to the one that you quoted me from), which isn’t true.
Either way, thanks for explaining the relationship between those two files! You’re quite right to suggest that I hadn’t looked this up yet. Knowing this dynamic now, and given that the OP didn’t actually specify which file(s) he had already looked at, it would have been a good idea to ask him to clarify this; it’s possible that he was looking at the same file that I was, and that the one that you mentioned has the TOML configuration that he was expecting to find.