Skip to main content

subtract_conceals

Function subtract_conceals 

Source
pub fn subtract_conceals(
    col: u32,
    source_col: u32,
    conceals: &[ConcealRange],
) -> u32
Expand description

Remove the concealed columns lying before source_col from an otherwise-computed display column.

Split out from source_byte_to_display_col because the GPU peer computes its inlay term differently — it resolves the source byte to a char column itself and filters inlays by byte rather than by column. Reconciling that is a separate question with its own non-ASCII risk; what must not happen meanwhile is two implementations of the conceal clamp, because the symptom of a stale one is a caret sitting off its own match on one renderer and not the other.

col is the display column before conceal; source_col is the position in the source line’s own column space, which is what conceal ranges are expressed in.