Community
    • Login

    .tab files are opening as toml files. How do I fix this?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 3 Posters 217 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Chris DenbyC
      Chris Denby
      last edited by

      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?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Chris Denby
        last edited by

        @Chris-Denby ,

        Weird. When I open a file called blah.tab , it shows up as “extended crontab file” (Lanugage > N > nncrontab), because nncrontab does have tab in its default extension list (as seen in Style Configurator).

        If I edit %AppData%\Notepad++\langs.xml and remove tab from the nncrontab default extension list, save, then exit Notepad++ completely, when I re-run Notepad++ and load a blah.tab , it is recognized as plain text rather than nncrontab. (If you left blah.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.)

        1 Reply Last reply Reply Quote 2
        • mathlete2M
          mathlete2
          last edited by

          @Chris-Denby like @PeterJones, I have tab listed in the nncrontab language. If his suggestion of removing that extension doesn’t help, maybe try adding tab to the ext list for normal - it should be the first language in langs.model.xml.

          PeterJonesP Chris DenbyC 2 Replies Last reply Reply Quote 0
          • Chris DenbyC
            Chris Denby @mathlete2
            last edited by

            @mathlete2 Ok - I’ve done both - removed it from nncrontab and added it to normal and it’s working.
            Thanks.

            mathlete2M 1 Reply Last reply Reply Quote 2
            • PeterJonesP
              PeterJones @mathlete2
              last edited by PeterJones

              @mathlete2 ,

              maybe try adding tab to the ext list for normal

              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.


              @Chris-Denby ,

              While you are following my advice (removing tab from nncrontab), you can also do a regular-expression search for ext="[^"]*\btab\b[^"]*" , which will find if tab 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 have tab in one (or more) of your “User ext.” lists.

              mathlete2M 1 Reply Last reply Reply Quote 0
              • mathlete2M
                mathlete2 @PeterJones
                last edited by mathlete2

                @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.

                1 Reply Last reply Reply Quote 0
                • mathlete2M
                  mathlete2 @Chris Denby
                  last edited by

                  @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.

                  PeterJonesP 1 Reply Last reply Reply Quote 0
                  • PeterJonesP
                    PeterJones @mathlete2
                    last edited by

                    @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 new langs.xml – If Notepad++ sees that there is no langs.xml, then it will copy langs.model.xml to langs.xml. But if you already have langs.xml, then editing langs.model.xml will do nothing for you (unless or until you also delete your active langs.xml).

                    mathlete2M 1 Reply Last reply Reply Quote 1
                    • mathlete2M
                      mathlete2 @PeterJones
                      last edited by

                      @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.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors