Community
    • Login

    User Extensions for Language Recognition not working for custom styles

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 2 Posters 350 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.
    • Tobias GebhardT
      Tobias Gebhard
      last edited by

      I added some file extensions for syntax highlighting (Lua). This works well with the default style. But after switching to another style (Obsidian), only .lua files are recognized, not my custom ones.

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

        @Tobias-Gebhard ,

        The user ext. field is apparently saved per-theme, so when you change from one theme to another, the changes you made in the first theme (including the user extension list) don’t apply to any other theme.

        Thus, the sequence I had to go through to make it work for a new theme:

        1. Select theme (Obsidian)
        2. Save and close Style Configurator
          (you have to save&close here, because right now, the user extension box doesn’t exist)
        3. Style Configurator > Lua
        4. add your custom extension (my experiment used clua, which was short for “custom lua”)
        5. save and close Style Configurator
        6. Now if you open a standard blah.lua or a custom blah.clua, both will use the Lua syntax highlighting.
        Tobias GebhardT 1 Reply Last reply Reply Quote 1
        • Tobias GebhardT
          Tobias Gebhard @PeterJones
          last edited by

          @PeterJones
          Strange, with clua it’s working. Not so with .con file.

          4fe94a4f-c278-45f9-bb18-c0dbf14d8d36-image.png

          Maybe because I used it as user extension for other themes before?

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

            @Tobias-Gebhard said in User Extensions for Language Recognition not working for custom styles:

            @PeterJones
            Strange, with clua it’s working. Not so with .con file.
            Maybe because I used it as user extension for other themes before?

            Doubtful.

            I tried some experiments. The first time I tried using clua con mdl module as my user-extensions, I thought I replicated your results, and when I opened blah.con, it seemed to mark it as text.

            I was starting to think that con was somehow getting confused with CON, the DOS console pseudo-file. I know that in other circumstances, the “user extension” also applies if it’s the exact name of the file, and I thought maybe the DOS pseudo-files would create extensions that didn’t work. So I changed to clua con prn nul mdl module, and opened some files with those extensions: now all of them interpreted as Lua, even the .con file.

            I went to just con as the user-extension list, and opening other.con worked and was associated as Lua.

            I tried going back to clua con mdl module, and now that’s working – every .con file I open, or when I create a new file and save-as anything.con, it works for me. I can exit and restart Notepad++, and that mapping is still there.

            You might try clearing the user extensions for Lua, setting it only to con, exiting Notepad++ and coming back in, and see if it works.

            If not, please share your ? menu Debug Info (you can copy/paste from that dialog into your reply)

            1 Reply Last reply Reply Quote 1
            • Tobias GebhardT
              Tobias Gebhard
              last edited by

              I wrote only “con” to the list and it didn’t work. Every other ending is working, except the ones I used before.

              But I also found out, this happens only at Obsidian. Not the other themes.
              I customized the settings of Obsidian before, maybe that’s the problem.

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

                @Tobias-Gebhard said in User Extensions for Language Recognition not working for custom styles:

                But I also found out, this happens only at Obsidian. Not the other themes.

                Hmm, maybe use the Compare plugin to look at your Obsidian.xml theme vs the master copy of Obsidian.xml, and see whether any of the differences jump out as “this may break things”.

                1 Reply Last reply Reply Quote 0
                • Tobias GebhardT
                  Tobias Gebhard
                  last edited by

                  Ok, I checked with the original Obsidian.xml and it works now.
                  Although the Lua block is the same, this strange behavior still exists. (They are only differences in other languages or maybe because of Global Style).
                  If anyone wants to further investigate, I would upload the files here, but I can’t.

                  Anyway, thank you for the help.

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