Closed craigo- closed 6 years ago
The order is defined by the (internal) array of references to available Lexers:
// This array holds all the lexers...
// Don't forget to change the number of the lexer for HTML and XML
// in Notepad2.c ParseCommandLine() if you change this array!
PEDITLEXER pLexArray[NUMLEXERS] =
{
&lexDefault,
&lexANSI,
&lexAHK,
&lexASM,
&lexAU3,
&lexAVS,
&lexAwk,
&lexBASH,
&lexBAT,
&lexCOFFEESCRIPT,
&lexCONF, //Apache Config Scripts
&lexCPP,
&lexCS,
&lexCSS,
&lexCmake,
&lexD,
&lexDIFF,
&lexGo,
&lexHTML,
&lexINNO,
&lexJAVA,
&lexJS,
&lexJSON,
&lexLATEX,
&lexLUA,
&lexMAK,
&lexMARKDOWN,
&lexMATLAB,
&lexNSIS,
&lexPAS,
&lexPL,
&lexPROPS,
&lexPS,
&lexPY,
&lexRC,
&lexRUBY,
&lexRegistry,
&lexSQL,
&lexTCL,
&lexVB,
&lexVBS,
&lexVHDL,
&lexXML,
&lexYAML
};
It is (allmost) sorted, but unrelated to the display-names given to them ....
Ah, I see. So there is a list of internal names (e.g. "lexBASH"), each of which has a scheme name (e.g. "Comment Doc").
The 'odd' ordering then comes from two sources:
Some of the scheme names could be clearer. Can I suggest:
Typedefs/Classes
-> ANSI Files
Comment Doc
-> Shell Script
Windows Registry Files
-> Registry Files
(we don't call Batch Files Windows files either)XML Document
-> XML Files
(or simply XML
?)Could we then sort the list by scheme name, i.e.:
PEDITLEXER pLexArray[NUMLEXERS] =
{
&lexDefault, // Default Text
&lexANSI, // ANSI Files
&lexCONF, // Apache Config Files
&lexASM, // Assembly Script
&lexAHK, // AutoHotkey Script
&lexAU3, // AutoIt3 Script
&lexAVS, // AviSynth Script
&lexAwk, // Awk Script
&lexBAT, // Batch Files
&lexCPP, // C/C++ Source Code
&lexCS, // C# Source Code
&lexCmake, // Cmake Script
&lexCOFFEESCRIPT, // Coffeescript
&lexPROPS, // Configuration Files
&lexCSS, // CSS Style Sheets
&lexD, // D Source Code
&lexDIFF, // Diff Files
&lexGo, // Go Source Code
&lexINNO, // Inno Setup Script
&lexJAVA, // Java Source Code
&lexJS, // JavaScript
&lexJSON, // JSON
&lexLATEX, // LaTeX Files
&lexLUA, // Lua Script
&lexMAK, // Makefiles
&lexMARKDOWN, // Markdown
&lexMATLAB, // MATLAB
&lexNSIS, // NSIS Script
&lexPAS, // Pascal Source Code
&lexPL, // Perl Script
&lexPS, // PowerShell Script
&lexPY, // Python Script
&lexRegistry, // Registry Files
&lexRC, // Resource Script
&lexRUBY, // Ruby Script
&lexBASH, // Shell Script
&lexSQL, // SQL Query
&lexTCL, // Tcl Script
&lexVB, // Visual Basic
&lexVBS, // VBScript
&lexVHDL, // VHDL
&lexHTML, // Web Source Code
&lexXML, // XML Files
&lexYAML // YAML
};
Oh, seen too late, I fixed it a little bit in 1219.755, but this is better, i will do a 1219.756 ...
... build beta 1219.756 is out ... ;-) (I stick to XML Document, cause I am used to it, hope You don't mind)
Good stuff, @RaiKoHoff - thank you.
Re: XML Document
: That's fine... I'm just a stickler for standardisation wherever possible, and noticed that none of the other schemes used the word "Document". There were plenty of examples of the use of the word "Files".
@craigo- Please confirm fixed and close this issue. New release available on the Notepad3 download page. 😸 Find the change log on the Notepad3 update page. 😺 Thanks for testing!
Notepad3 beta build 3.17.1218.753 (and pretty much every previous build)...
Assuming the ordering of the schemes in the "Customize Schemes" dialogue is under the program's control (I think it is), why is it ordered the way it is? With the exception of the "Default Text" scheme (which should be at the top), I think it makes more sense for the list to be ordered alphabetically..?
For reference (excluding the "Default Text" scheme):