Fix highlight of CR, LF, CRLF

Properly highlight CR, LF, and CRLF combinations that can occur in code or other files (like MIME).
This commit is contained in:
Marc Bernard 2025-02-22 16:02:11 +00:00
parent 90cb2201fa
commit 80d6363d92

View File

@ -282,7 +282,10 @@ CLASS zcl_abapgit_syntax_highlighter IMPLEMENTATION.
rv_line = iv_line.
IF mv_hidden_chars = abap_true.
" The order of these replacements matters to properly show CR, LF, and CRLF
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN rv_line WITH ' → '.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN rv_line WITH '¶'.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>newline IN rv_line WITH '↵'.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf(1) IN rv_line WITH '¶'.
REPLACE ALL OCCURRENCES OF ` ` IN rv_line WITH '·'.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>form_feed IN rv_line