Menu

#2134 LexYAML style is broken after 1024 bytes

Bug
closed-fixed
nobody
5
2023-12-25
2019-10-21
Zufu Liu
No

The line char lineBuffer[1024] = ""; in ColouriseYAMLDoc() cause it.

There are similar bugs already reported, but for other lexers.

F:\Libs\scintilla\lexers>grep -nr "lineBuffer\[1024\]"
LexBatch.cxx:469:       char lineBuffer[1024];
LexMake.cxx:118:        char lineBuffer[1024];
LexMetapost.cxx:125:    char lineBuffer[1024] ;
LexProps.cxx:82:        char lineBuffer[1024];
LexTeX.cxx:128:    char lineBuffer[1024] ;
LexYAML.cxx:206:        char lineBuffer[1024] = "";

Related

Bugs: #1933
Feature Requests: #1271

Discussion

  • Zufu Liu

    Zufu Liu - 2019-10-21

    The 1024 bytes limit will cause another bug for multibyte character in LayoutLine:
    line break will be added inside multibyte characters that across the style boundary, each/some part will be drawn as hex code.

     
  • Zufu Liu

    Zufu Liu - 2023-03-16

    remains three lexers:

    D:\notepad2\lexilla\lexers>rg "lineBuffer\[1024\]"
    LexTeX.cxx
    131:    char lineBuffer[1024] ;
    
    LexMetapost.cxx
    128:    char lineBuffer[1024] ;
    
    LexBatch.cxx
    120:    char lineBuffer[1024] {};
    
     
  • Neil Hodgson

    Neil Hodgson - 2023-03-16

    TeX and Metapost aren't performing byte-level styling with their 1024-byte strings. They are looking for interface=x and %D \\module from the file start to determine the language and set of keywords.

     
  • Neil Hodgson

    Neil Hodgson - 2023-12-25
    • labels: lexer --> lexer, lexilla
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB