Improve documentation
This commit is contained in:
parent
384c5c1fdc
commit
3331f41d7a
6 changed files with 37 additions and 14 deletions
|
|
@ -35,7 +35,7 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn set_layout_cursor(&mut self, font_system: &mut FontSystem, cursor: LayoutCursor) {
|
||||
fn set_layout_cursor(&mut self, font_system: &mut FontSystem, cursor: LayoutCursor) {
|
||||
let layout = self
|
||||
.buffer
|
||||
.line_layout(font_system, cursor.line)
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ pub enum Action {
|
|||
|
||||
/// A trait to allow easy replacements of [`Editor`], like `SyntaxEditor`
|
||||
pub trait Edit {
|
||||
/// Mutably borrows `self` together with an [`FontSystem`] for more convenient methods
|
||||
fn borrow_with<'a>(
|
||||
&'a mut self,
|
||||
font_system: &'a mut FontSystem,
|
||||
|
|
|
|||
|
|
@ -60,8 +60,13 @@ impl<'a> SyntaxEditor<'a> {
|
|||
})
|
||||
}
|
||||
|
||||
/// Load text from a file, and also set syntax to the best option
|
||||
///
|
||||
/// ## Errors
|
||||
///
|
||||
/// Returns an [`io::Error`] if reading the file fails
|
||||
#[cfg(feature = "std")]
|
||||
pub(crate) fn load_text<P: AsRef<Path>>(
|
||||
pub fn load_text<P: AsRef<Path>>(
|
||||
&mut self,
|
||||
font_system: &mut FontSystem,
|
||||
path: P,
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@ impl<'a> ViEditor<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Load text from a file, and also set syntax to the best option
|
||||
#[cfg(feature = "std")]
|
||||
pub(crate) fn load_text<P: AsRef<std::path::Path>>(
|
||||
pub fn load_text<P: AsRef<std::path::Path>>(
|
||||
&mut self,
|
||||
font_system: &mut FontSystem,
|
||||
path: P,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue