Make Edit::copy_selection immutable
This commit is contained in:
parent
1eab951e27
commit
6235716beb
4 changed files with 4 additions and 4 deletions
|
|
@ -109,7 +109,7 @@ impl Edit for Editor {
|
|||
}
|
||||
}
|
||||
|
||||
fn copy_selection(&mut self) -> Option<String> {
|
||||
fn copy_selection(&self) -> Option<String> {
|
||||
let select = self.select_opt?;
|
||||
|
||||
let (start, end) = match select.line.cmp(&self.cursor.line) {
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ pub trait Edit {
|
|||
fn shape_as_needed(&mut self, font_system: &mut FontSystem);
|
||||
|
||||
/// Copy selection
|
||||
fn copy_selection(&mut self) -> Option<String>;
|
||||
fn copy_selection(&self) -> Option<String>;
|
||||
|
||||
/// Delete selection, adjusting cursor and returning true if there was a selection
|
||||
// Also used by backspace, delete, insert, and enter when there is a selection
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ impl<'a> Edit for SyntaxEditor<'a> {
|
|||
self.editor.shape_as_needed(font_system);
|
||||
}
|
||||
|
||||
fn copy_selection(&mut self) -> Option<String> {
|
||||
fn copy_selection(&self) -> Option<String> {
|
||||
self.editor.copy_selection()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ impl<'a> Edit for ViEditor<'a> {
|
|||
self.editor.shape_as_needed(font_system);
|
||||
}
|
||||
|
||||
fn copy_selection(&mut self) -> Option<String> {
|
||||
fn copy_selection(&self) -> Option<String> {
|
||||
self.editor.copy_selection()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue