Community
    • Login

    Notepad sees files with .tcl extension as shell file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    11 Posts 4 Posters 1.1k 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.
    • EkopalypseE
      Ekopalypse @Gor Abgaryan 0
      last edited by

      @Gor-Abgaryan-0

      this works for me, could it be that .tcl is added into the user ext setting of the bash lexer?

      4de6a3b3-a62d-4140-b2b6-e0d748776b48-image.png

      Gor Abgaryan 0G 1 Reply Last reply Reply Quote 1
      • Gor Abgaryan 0G
        Gor Abgaryan 0 @Ekopalypse
        last edited by

        @Ekopalypse
        Hi. Thanks for your feedback. Nope, there is only my username in extensions part
        ext.png

        1 Reply Last reply Reply Quote 0
        • Gor Abgaryan 0G
          Gor Abgaryan 0 @Gor Abgaryan 0
          last edited by

          @Gor-Abgaryan-0

          Found the issue, but still need to be fixed.
          The first 3 lines of the code are:

          #!/bin/sh
          #\
          exec tclsh $0 ${1+“$@”}

          removing these lines fixes the problem, but these lines need to be there

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Gor Abgaryan 0
            last edited by

            @Gor-Abgaryan-0 said in Notepad sees files with .tcl extension as shell file:

            #!/bin/sh

            Sorry, that line is going to override your file’s extension and set Notepad++ up to lex the document as shell.

            Gor Abgaryan 0G 2 Replies Last reply Reply Quote 1
            • Gor Abgaryan 0G
              Gor Abgaryan 0 @Alan Kilborn
              last edited by

              @Alan-Kilborn
              Thanks. Isn’t there a way to disable that and make npp read only the file extension for highlighting?

              Alan KilbornA 1 Reply Last reply Reply Quote 0
              • Gor Abgaryan 0G
                Gor Abgaryan 0 @Alan Kilborn
                last edited by

                @Alan-Kilborn
                And one more question about extensions.
                I have .v/.sv extensions for Verilog, but I need also .sv.bck to be read as Verilog. But it is not working. Is there a way to let it work?

                PeterJonesP 1 Reply Last reply Reply Quote 0
                • Alan KilbornA
                  Alan Kilborn @Gor Abgaryan 0
                  last edited by Alan Kilborn

                  @Gor-Abgaryan-0 said in Notepad sees files with .tcl extension as shell file:

                  Isn’t there a way to disable that and make npp read only the file extension for highlighting?

                  I don’t believe so.

                  I need also .sv.bck to be read as Verilog. Is there a way to let it work?

                  I don’t think so.

                  But I could be wrong. Perhaps someone will respond that has a different opinion.

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

                    @Gor-Abgaryan-0 said in Notepad sees files with .tcl extension as shell file:

                    I need also .sv.bck to be read as Verilog

                    If you are editing blah.sv.bck and nothing else using the .bck extension, so that all .bck files that you are editing are Verilog, then you can just use bck in the User Extension list for Verilog. Reason why it didn’t work for you: When Notepad++ is doing the extension matching, it only looks from the final dot to the end, so it only compares the bck portion, which then doesn’t match a User Ext: sv.bck

                    With some effort, you can create a macro for changing the current file to Verilog, and assign that macro to a keyboard shortcut, so that you could then just use that shortcut anytime you load a .sv.bck file. (Unfortunately, Languages aren’t in the Shortcut Mapper, and changing Langauge isn’t macro-recordable; but if you manually edit your macro file to have a macro calling <Action type="2" message="0" wParam="46043" lParam="0" sParam="" />, and restart Notepad++, that Macro will then be available to assign a keyboard shortcut to, and it will do that action, even though you couldn’t record it.)

                    Or you could use a scripting plugin (like Python Script) to set up a callback which every time you open a new file, it checks the filename, and if that ends in .sv.bck then change the language to Verilog.

                    Gor Abgaryan 0G 1 Reply Last reply Reply Quote 1
                    • Gor Abgaryan 0G
                      Gor Abgaryan 0 @PeterJones
                      last edited by

                      @PeterJones
                      Thanks for the feedback.
                      And what about <#!/bin/sh> at the beginning of the tcl file? Is there a way to read this file as a TCL file? There were a feedback saying there is no way.

                      Alan KilbornA 1 Reply Last reply Reply Quote 0
                      • Alan KilbornA
                        Alan Kilborn @Gor Abgaryan 0
                        last edited by Alan Kilborn

                        @Gor-Abgaryan-0 said in Notepad sees files with .tcl extension as shell file:

                        And what about <#!/bin/sh> at the beginning of the tcl file? Is there a way to read this file as a TCL file?
                        There were a feedback saying there is no way.

                        I still don’t believe this is currently possible, but I think a change is coming soon to Notepad++ to allow this to happen.

                        This ISSUE that came up recently describes a similar situation and links to some others discussing the impending code change.

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