Menu

#1475 Use fixed character array for C0 and C1 control character name list

Won't_Implement
closed
5
2023-03-08
2023-01-18
Zufu Liu
No

in Editor::SetRepresentations() and ControlCharacterString(), const char *const reps[] can be changed to static constexpr char reps[][4].

with the change Scintilla.dll is 1KiB smaller.

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2023-01-20

    To me, adding bounds makes the code more fragile and difficult to modify.

     
  • Zufu Liu

    Zufu Liu - 2023-01-20

    These name are standardized and will not changed in the further, if the bounds is smaller (e.g. not including NUL terminator) there is a compiler error.

     
  • Zufu Liu

    Zufu Liu - 2023-01-27
    • Group: Initial --> Won't_Implement
     
  • Neil Hodgson

    Neil Hodgson - 2023-02-08

    May be sensible to share the C0 strings between SetRepresentations and ControlCharacterString and extract these to another module. Either in PositionCache as that is where SpecialRepresentations currently lives or into a new Representations module.

    Something like the attached patch.

     
  • Zufu Liu

    Zufu Liu - 2023-02-09

    Adding SetDefaultRepresentations() looks good to me.

     
  • Neil Hodgson

    Neil Hodgson - 2023-02-12

    Moved default representation code into SpecialRepresentations class with [7cf62b].

     

    Related

    Commit: [7cf62b]

  • Neil Hodgson

    Neil Hodgson - 2023-03-08
    • status: open --> closed
     
  • Neil Hodgson

    Neil Hodgson - 2023-03-08

    The original feature won't be included.

     

Log in to post a comment.

MongoDB Logo MongoDB