range_text Function

private pure function range_text(start, n) result(text)

start,n for a hunk header; start is the line before the hunk when it is empty.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: start

first line of the hunk

integer, intent(in) :: n

number of lines in the hunk

Return Value character(len=:), allocatable


Calls

proc~~range_text~~CallsGraph proc~range_text range_text proc~to_s to_s proc~range_text->proc~to_s

Called by

proc~~range_text~~CalledByGraph proc~range_text range_text proc~unified_diff unified_diff proc~unified_diff->proc~range_text proc~process_text process_text proc~process_text->proc~unified_diff proc~process_file process_file proc~process_file->proc~process_text proc~process_stdin process_stdin proc~process_stdin->proc~process_text proc~run run proc~run->proc~process_file proc~run->proc~process_stdin

Source Code

pure function range_text(start, n) result(text)
    !! `start,n` for a hunk header; `start` is the line before the hunk when it is empty.
    integer, intent(in) :: start    !! first line of the hunk
    integer, intent(in) :: n        !! number of lines in the hunk
    character(len=:), allocatable :: text
    if (n == 0) then
        text = to_s(start - 1)//',0'
    else if (n == 1) then
        text = to_s(start)
    else
        text = to_s(start)//','//to_s(n)
    end if
end function range_text