pub enum FoldMethod {
Manual,
Indent,
Markdown,
Syntax,
Lsp,
}Expand description
:set foldmethod=... (DESIGN.md §15:18, C.2;
docs/user/folding.md). Decides which provider feeds the
per-buffer fold list.
Each variant’s marginalia doc (right of =>) is what
appears in :set foldmethod=<Tab>. Variant-level ///
docs are for API/rustdoc consumers. Slice
3c.unify.option-docs-builtin migrated this enum to
labeled_enum! — adding a new fold method is now one
line; the label / parse_label / doc / all
accessors are derived automatically.
D.3.f.0 added #[derive(Hash)] so the FoldRegistry
can key its primary-provider map on FoldMethod.
Variants§
Manual
Only user zf ranges, no auto-recompute.
Indent
Universal indent walker.
Markdown
ATX heading nesting (*.md).
Syntax
Tree-sitter scope queries; cascades to Markdown for
.md buffers and Indent otherwise when the tree-
sitter provider has nothing to offer.
Lsp
Feeds from textDocument/foldingRange. Async:
the per-tick pump fires the request when the buffer’s
document version changes; the response lands in a
per-buffer cache and triggers a recompute. Cascades to
Syntax when no attached server advertises the
capability.
Slice: 4.4.f.
Implementations§
Trait Implementations§
Source§impl Clone for FoldMethod
impl Clone for FoldMethod
Source§fn clone(&self) -> FoldMethod
fn clone(&self) -> FoldMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FoldMethod
Source§impl Debug for FoldMethod
impl Debug for FoldMethod
Source§impl Default for FoldMethod
impl Default for FoldMethod
Source§fn default() -> FoldMethod
fn default() -> FoldMethod
impl Eq for FoldMethod
Source§impl Hash for FoldMethod
impl Hash for FoldMethod
Source§impl PartialEq for FoldMethod
impl PartialEq for FoldMethod
impl StructuralPartialEq for FoldMethod
Auto Trait Implementations§
impl Freeze for FoldMethod
impl RefUnwindSafe for FoldMethod
impl Send for FoldMethod
impl Sync for FoldMethod
impl Unpin for FoldMethod
impl UnsafeUnpin for FoldMethod
impl UnwindSafe for FoldMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.