Skip to main content

FoldResolver

Trait FoldResolver 

Source
pub trait FoldResolver {
    // Required method
    fn fold_edge(&self, line: u32, forward: bool) -> Option<u32>;
}
Expand description

VM.3i: where zj / zk find the next fold edge.

Folds, and which of them are visible, are host state: the fold table and foldenable live on the editor, and “a closed fold is counted as one fold” needs the host’s fold index. So the grammar asks this, the way = asks IndentResolver, and the motion itself stays a pure function of the answer.

None from fold_edge means there’s no edge that way, and the motion leaves the cursor where it is, as vim does.

Required Methods§

Source

fn fold_edge(&self, line: u32, forward: bool) -> Option<u32>

The nearest visible fold START after line (forward), or the nearest visible fold END before it (!forward).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§