endingShapeEqual reports whether two line endings occupy the same "position class" for the splice substitution: both empty, or both in the newline class ({"\n", "\r\n"}). When this is true and the pair matched during matching, the splice uses the file's ending. When false, the splice keeps the repla
(a, b string)
| 922 | // lines don't silently pick up a missing EOF terminator from the |
| 923 | // reference content. |
| 924 | func endingShapeEqual(a, b string) bool { |
| 925 | if a == b { |
| 926 | return true |
| 927 | } |
| 928 | return isNewlineEnding(a) && isNewlineEnding(b) |
| 929 | } |
| 930 | |
| 931 | // buildReplacementLines emits the splice for a fuzzy match by |
| 932 | // per-position substitution at leading-ws, body, trailing-ws, and |
no test coverage detected