Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Assigned txt as user extension to javascript language in style config, but Notepad rarely applies settings correctly

daffyd48
2012-11-29
2012-11-29
  • daffyd48
    daffyd48
    2012-11-29

    I've not assigned txt to any other language other than javascript. The only files I open in Notepad++ have txt extensions. I only have one default global override setting (background color). Most of the time however, instead of recognizing the extension and applying the javascript language settings, my txt files just appear as plain black text, and even after I get Notepad++ to show the file text and fonts as set in the javascript settings, I frequently lose it again when I switch window views to another file or edit anything.

    The only way to consistently get Notepad++ to even apply the javascript language settings is to first select a random language, then select javascript. And then repeat this frequently after Notepad++ reverts the display to plain black text and fonts. Once it reverts to plain text, I can never get the javascript settings applied if I just select javascript without first selecting another random language. Using 6.2.2. Any help appreciated.

     
    Last edit: daffyd48 2012-11-29
  • I have not been able to reproduce that bug. If I set txt as user ext. for Javascript in Notepad++ 6.2.2, it seems to work as expected. Have you tried without plugins? (you can rename the "plugins" folder and restart Notepad++, to have all plugins disabled)

    As a comment, I would say that associating .txt files to Javascript is probably not the best general solution, as most people have .txt files also for other things. Personally, I would use my modeline parser plugin ( https://sourceforge.net/projects/npppythonplugsq/files/Modeline%20Parser/ ), to either have a line in the .txt file specifying it is Javascript, or adding a path based rule so that only .txt files in some folders would be considered Javascript.

     
  • daffyd48
    daffyd48
    2012-11-29

    Thanks very much for the suggestions. I quickly narrowed the issue down to the Compare plugin. When just the Compare plugin is installed, when I hit "compare" for two files, I noted that typically one of them will be partially converted to plain b&w text, and then when I hit "clear results" after a compare, it changes both the files to entirely plain b&w text, and I can only get back the proper format temporarily as described above. Without the Compare plugin and with my other plugins installed, no issues. Changing the extensions to .js has no impact on any of the above.

    I do use the Compare plugin heavily, however, so it would be great if someone could repeat some or all of my experience to confirm this.

     
    Last edit: daffyd48 2012-11-29