CLI Parameter "-l" does not work with user defined languages



  • Hi,

    I use Notepad++ in version 7.5.6

    I have prepared a user defined language to highlight target files for CNC-Machines which use a certain CNC.
    <UserLang name="G-Code" ext="DIN din NC nc CNC cnc BEV bev MHT mht target.txt" udlVersion="2.1">
    The name of the user language is “G-Code”.

    If I use the CLI in the following way
    Notepad++ -lG-Code myTextfile.txt

    I also have also tried to rename the language to “GCode” and use the following command line:
    Notepad++ -lGCode myTextfile.txt

    in both cases the code highlight of my user defined language is not selected.
    If I open a file with one of the defined file extensions it works properly and selects the correct user defined language.

    Have I done something wrong or is it just not implemented for user defined languages?

    Thanks in advance
    TMuel



  • @TMuel1123 in your ext definition I see target.txt, but I do not see txt. Maybe that’s your problem…



  • Hi Jim,

    I assumed the -l parameter as an override function for the detection of the language by the files extension. because if i try -lbash then it highlites it with the Bash code highlitning.

    If I use a *.din file it ofcause works, but then it uses the detection for the language of the file extension and i could omit the -l parameter.

    it is my intention to have the target.txt in my definition, because i dont want to have the highlight for all text files, but i ofetn open files which have the name target.txt, which i always want to have highlighted.

    Best regards
    TMuel