IndentHeuristic
API reference › Diff › IndentHeuristic
Holds the tuning values of Git’s indent heuristic, which LineDiffer uses to choose where a slidable group of
changed lines is placed.
Each candidate position is scored by the two splits around the group; the values match those of Git’s xdiffi.c.
See also: https://github.com/git/git/blob/master/xdiff/xdiffi.c (Git’s xdiffi.c.).
Constants
Section titled “Constants”| Constant | Value | Description | Defined by |
|---|---|---|---|
BLANK | -1 | Indentation measured for a line that holds only whitespace. | IndentHeuristic |
END_OF_FILE_PENALTY | 21 | Penalty for a split at the end of the input. | IndentHeuristic |
INDENT_WEIGHT | 60 | Weight of the indent comparison against the penalty difference when two positions are compared. | IndentHeuristic |
MAX_BLANKS | 20 | Maximum number of consecutive blank lines counted on each side of a split. | IndentHeuristic |
MAX_INDENT | 200 | Maximum indentation, in columns, that is measured. | IndentHeuristic |
MAX_SLIDING | 100 | Maximum number of positions examined for one group. | IndentHeuristic |
POST_BLANK_WEIGHT | 6 | Weight of the blank lines that follow a split. | IndentHeuristic |
RELATIVE_DEDENT_PENALTY | 23 | Penalty for a split before a line indented less than the previous non-blank line and not followed by a more indented line, without blank lines around the split. | IndentHeuristic |
RELATIVE_DEDENT_WITH_BLANK_PENALTY | 17 | Penalty for a split before a line indented less than the previous non-blank line and not followed by a more indented line, with blank lines around the split. | IndentHeuristic |
RELATIVE_INDENT_PENALTY | -4 | Penalty for a split before a line indented more than the previous non-blank line, without blank lines around the split; negative values favor the split. | IndentHeuristic |
RELATIVE_INDENT_WITH_BLANK_PENALTY | 10 | Penalty for a split before a line indented more than the previous non-blank line, with blank lines around the split. | IndentHeuristic |
RELATIVE_OUTDENT_PENALTY | 24 | Penalty for a split before a line indented less than the previous non-blank line and followed by a more indented line, without blank lines around the split. | IndentHeuristic |
RELATIVE_OUTDENT_WITH_BLANK_PENALTY | 17 | Penalty for a split before a line indented less than the previous non-blank line and followed by a more indented line, with blank lines around the split. | IndentHeuristic |
START_OF_FILE_PENALTY | 1 | Penalty for a split at the start of the input. | IndentHeuristic |
TAB_WIDTH | 8 | Number of columns between two tab stops. | IndentHeuristic |
TOTAL_BLANK_WEIGHT | -30 | Weight of the blank lines around a split; negative values favor blanks. | IndentHeuristic |