mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Visualize difference for EOF (#5404)
This commit is contained in:
parent
103790eb35
commit
995e77e949
|
@ -285,6 +285,8 @@ CLASS zcl_abapgit_syntax_highlighter IMPLEMENTATION.
|
|||
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab 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
|
||||
WITH '<span class="red">⊝</span>'.
|
||||
|
||||
IF strlen( rv_line ) BETWEEN 1 AND 2.
|
||||
lv_bom = zcl_abapgit_convert=>string_to_xstring( rv_line ).
|
||||
|
|
|
@ -486,12 +486,34 @@ CLASS zcl_abapgit_diff IMPLEMENTATION.
|
|||
METHOD unpack.
|
||||
|
||||
DATA: lv_new TYPE string,
|
||||
lv_old TYPE string.
|
||||
|
||||
lv_old TYPE string,
|
||||
lv_new_last TYPE c LENGTH 1,
|
||||
lv_old_last TYPE c LENGTH 1.
|
||||
|
||||
lv_new = zcl_abapgit_convert=>xstring_to_string_utf8( iv_new ).
|
||||
lv_old = zcl_abapgit_convert=>xstring_to_string_utf8( iv_old ).
|
||||
|
||||
" Check if one value contains a final newline but the other not
|
||||
" If yes, add a special characters that's visible in diff render
|
||||
IF lv_new IS NOT INITIAL.
|
||||
lv_new_last = substring(
|
||||
val = lv_new
|
||||
off = strlen( lv_new ) - 1 ).
|
||||
ENDIF.
|
||||
IF lv_old IS NOT INITIAL.
|
||||
lv_old_last = substring(
|
||||
val = lv_old
|
||||
off = strlen( lv_old ) - 1 ).
|
||||
ENDIF.
|
||||
|
||||
IF lv_new_last = zif_abapgit_definitions=>c_newline AND lv_old_last <> zif_abapgit_definitions=>c_newline
|
||||
AND lv_old IS NOT INITIAL.
|
||||
lv_old = lv_old && cl_abap_char_utilities=>form_feed.
|
||||
ELSEIF lv_new_last <> zif_abapgit_definitions=>c_newline AND lv_old_last = zif_abapgit_definitions=>c_newline
|
||||
AND lv_new IS NOT INITIAL.
|
||||
lv_new = lv_new && cl_abap_char_utilities=>form_feed.
|
||||
ENDIF.
|
||||
|
||||
SPLIT lv_new AT zif_abapgit_definitions=>c_newline INTO TABLE et_new.
|
||||
SPLIT lv_old AT zif_abapgit_definitions=>c_newline INTO TABLE et_old.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user