Add Editor::insert_text
This commit is contained in:
parent
c5a5913981
commit
39d3219df9
2 changed files with 30 additions and 19 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#[cfg(not(feature = "std"))]
|
||||
use alloc::string::String;
|
||||
|
||||
use crate::{Buffer, Cursor};
|
||||
use crate::{AttrsList, Buffer, Cursor};
|
||||
#[cfg(feature = "swash")]
|
||||
use crate::Color;
|
||||
|
||||
|
|
@ -86,6 +86,10 @@ pub trait Edit<'a> {
|
|||
// Also used by backspace, delete, insert, and enter when there is a selection
|
||||
fn delete_selection(&mut self) -> bool;
|
||||
|
||||
/// Insert a string at the current cursor or replacing the current selection with the given
|
||||
/// attributes, or with the previous character's attributes if None is given.
|
||||
fn insert_string(&mut self, data: &str, attrs_list: Option<AttrsList>);
|
||||
|
||||
/// Perform an [Action] on the editor
|
||||
fn action(&mut self, action: Action);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue