Make Clipboard argument in Widget trait mutable
This commit is contained in:
parent
35425001ed
commit
21971e0037
31 changed files with 173 additions and 127 deletions
|
|
@ -73,6 +73,15 @@ impl Value {
|
|||
.unwrap_or(self.len())
|
||||
}
|
||||
|
||||
/// Returns a new [`Value`] containing the graphemes from `start` until the
|
||||
/// given `end`.
|
||||
pub fn select(&self, start: usize, end: usize) -> Self {
|
||||
let graphemes =
|
||||
self.graphemes[start.min(self.len())..end.min(self.len())].to_vec();
|
||||
|
||||
Self { graphemes }
|
||||
}
|
||||
|
||||
/// Returns a new [`Value`] containing the graphemes until the given
|
||||
/// `index`.
|
||||
pub fn until(&self, index: usize) -> Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue