Page diff/patch: Follow-up for small files (#5976)

This commit is contained in:
Marc Bernard 2023-01-06 20:04:00 +01:00 committed by GitHub
parent 8e05c34287
commit f009ec0f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1025,13 +1025,10 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
" Get line where diff really starts " Get line where diff really starts
READ TABLE lt_diffs ASSIGNING <ls_diff_line> INDEX lv_tabix + 8. READ TABLE lt_diffs ASSIGNING <ls_diff_line> INDEX lv_tabix + 8.
IF sy-subrc <> 0. IF sy-subrc <> 0.
IF <ls_diff_line> IS NOT ASSIGNED. " Occurs only for small files/diffs with less than 8 lines.
" Occurs only for small files/diffs with less than 8 lines. " Therefore let's use the first line as beacon
" Therefore let's use the first line as beacon ASSIGN <ls_diff> TO <ls_diff_line>.
READ TABLE lt_diffs ASSIGNING <ls_diff_line> INDEX lv_tabix.
ENDIF.
ASSERT <ls_diff_line> IS ASSIGNED. ASSERT <ls_diff_line> IS ASSIGNED.
ASSIGN <ls_diff_line> TO <ls_diff>.
ENDIF. ENDIF.
ri_html->add( render_beacon( is_diff_line = <ls_diff_line> ri_html->add( render_beacon( is_diff_line = <ls_diff_line>
is_diff = is_diff ) ). is_diff = is_diff ) ).
@ -1042,9 +1039,9 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
<ls_diff>-new = lo_highlighter->process_line( <ls_diff>-new ). <ls_diff>-new = lo_highlighter->process_line( <ls_diff>-new ).
<ls_diff>-old = lo_highlighter->process_line( <ls_diff>-old ). <ls_diff>-old = lo_highlighter->process_line( <ls_diff>-old ).
ELSE. ELSE.
<ls_diff>-new = escape( val = <ls_diff>-new <ls_diff>-new = escape( val = <ls_diff>-new
format = cl_abap_format=>e_html_attr ). format = cl_abap_format=>e_html_attr ).
<ls_diff>-old = escape( val = <ls_diff>-old <ls_diff>-old = escape( val = <ls_diff>-old
format = cl_abap_format=>e_html_attr ). format = cl_abap_format=>e_html_attr ).
ENDIF. ENDIF.