rizonesoft / Notepad3

Notepad like text editor based on the Scintilla source code. Notepad3 based on code from Notepad2 and MiniPath on code from metapath. Download Notepad3:
https://www.rizonesoft.com/downloads/notepad3/
Other
5.14k stars 336 forks source link

Ordering of list of schemes in 'Customize Schemes' dialogue #242

Closed craigo- closed 6 years ago

craigo- commented 6 years ago

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):

RaiKoHoff commented 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 ....

craigo- commented 6 years ago

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:

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
};
RaiKoHoff commented 6 years ago

Oh, seen too late, I fixed it a little bit in 1219.755, but this is better, i will do a 1219.756 ...

RaiKoHoff commented 6 years ago

... build beta 1219.756 is out ... ;-) (I stick to XML Document, cause I am used to it, hope You don't mind)

craigo- commented 6 years ago

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".

rizonesoft commented 6 years ago

@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!