Notepad sees files with .tcl extension as shell file
-
Notepad sees a file with .tcl extension as a shell file although the default extension <tcl> is set for TCL language in Settings>Style configurator .
-
this works for me, could it be that .tcl is added into the user ext setting of the bash lexer?
-
@Ekopalypse
Hi. Thanks for your feedback. Nope, there is only my username in extensions part
-
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
-
@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.
-
@Alan-Kilborn
Thanks. Isn’t there a way to disable that and make npp read only the file extension for highlighting? -
@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? -
@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.
-
@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 thebck
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. -
@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. -
@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.