Struct nvimpam_lib::folds::FoldList [−][src]
pub struct FoldList { /* fields omitted */ }
Holds the fold data of the buffer. A fold has the following data: Linenumbers start, end (indexed from 1), 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 fold (start, end) into the FoldList. If the length of the fold is less than 2, or the card is a Comment, we silently return without doing anything. 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 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, lines: &[String]) -> Result<(), Error>
[src]
pub fn recreate_all(&mut self, lines: &[String]) -> Result<(), Error>
Remove all the entries from the FoldList, and iterate over lines to populate it with new ones
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 TODO: Check if we're using the best method to send
pub fn into_vec(self) -> Vec<(u64, u64, Keyword)>
[src]
pub fn into_vec(self) -> Vec<(u64, u64, Keyword)>
Turn the FoldList into a Vec, containing the tuples (start, end, Keyword)
pub fn add_folds<T: AsRef<str>>(&mut self, lines: &[T]) -> Result<(), Error>
[src]
pub fn add_folds<T: AsRef<str>>(&mut self, lines: &[T]) -> Result<(), Error>
Parse an array of strings 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.