[−][src]Struct nvimpam_lib::folds::FoldList
Holds the fold data of the buffer. A fold has the following data: Linenumbers start, end (indexed from 0), and a Keyword.
Methods
impl FoldList
[src]
impl FoldList
pub fn new() -> FoldList
[src]
pub fn new() -> FoldList
Create a new FoldList. There does not seem to be a way to create one with a predetermined capacity.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clear FoldList, by clearing the BTreeMap's individually
pub fn checked_insert(
&mut self,
start: u64,
end: u64,
kw: Keyword
) -> Result<(), Error>
[src]
pub fn checked_insert(
&mut self,
start: u64,
end: u64,
kw: Keyword
) -> Result<(), Error>
Insert a level 1 fold ([start, end], Keyword)
into the FoldList. If
end < start
, we silently return. Otherwise, we call the internal
insert function that returns an error if the fold is already in the
list. In that case, it needs to be
removed
beforehand.
pub fn remove(&mut self, start: u64, end: u64) -> Result<(), Error>
[src]
pub fn remove(&mut self, start: u64, end: u64) -> Result<(), Error>
Remove a level 1 fold [start, end] from the foldlist. Only checks if the fold is in the FoldList, and returns an error otherwise.
pub fn recreate_all(
&mut self,
keywords: &[Option<Keyword>],
lines: &[Line]
) -> Result<(), Error>
[src]
pub fn recreate_all(
&mut self,
keywords: &[Option<Keyword>],
lines: &[Line]
) -> Result<(), Error>
Remove all the entries from the FoldList, and iterate over lines to populate it with new ones. Then recreate the level 2 folds.
pub fn resend_all(&self, nvim: &mut Neovim) -> Result<(), Error>
[src]
pub fn resend_all(&self, nvim: &mut Neovim) -> Result<(), Error>
Delete all folds in nvim, and create the ones from the FoldList.
pub fn to_vec(&self, level: u8) -> Vec<(u64, u64, Keyword)>
[src]
pub fn to_vec(&self, level: u8) -> Vec<(u64, u64, Keyword)>
Copy the elements of a FoldList of the given level into a Vec, containing the tuples (start, end, Keyword)
pub fn add_folds(
&mut self,
keywords: &[Option<Keyword>],
lines: &[Line]
) -> Result<(), Error>
[src]
pub fn add_folds(
&mut self,
keywords: &[Option<Keyword>],
lines: &[Line]
) -> Result<(), Error>
Parse an array of Option<Keyword>
s into a
FoldList
. The foldlist is cleared as a first step.
Creates only level 1 folds. Depending on the
ownfold
parameter in the
definition of the card in the carddata module, each card
will be in an own fold, or several adjacent (modulo comments) cards will
be subsumed into a fold.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more