Skip to main content

DisplayResolver

Trait DisplayResolver 

Source
pub trait DisplayResolver {
    // Required methods
    fn wrap_width(&self) -> u32;
    fn segments(&self, line: u32) -> u32;
}
Expand description

VM.3g-2: what the DISPLAY looks like, for gj / gk / g0 / g$. Soft wrap is a rendering decision — the wrap width, and how many rows a line takes once tabs and wide characters are measured — so the grammar asks rather than computes, exactly as it does for folds and the viewport.

Required Methods§

Source

fn wrap_width(&self) -> u32

Soft-wrap width in columns, or 0 when wrap is off — which degrades gj to j and g0 to 0, as vim does.

Source

fn segments(&self, line: u32) -> u32

How many display rows line occupies. 1 when wrap is off.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§