diff --git a/src/edit/editor.rs b/src/edit/editor.rs index 2374ab8..4277ae1 100644 --- a/src/edit/editor.rs +++ b/src/edit/editor.rs @@ -109,7 +109,7 @@ impl Edit for Editor { } } - fn copy_selection(&mut self) -> Option { + fn copy_selection(&self) -> Option { let select = self.select_opt?; let (start, end) = match select.line.cmp(&self.cursor.line) { diff --git a/src/edit/mod.rs b/src/edit/mod.rs index 77e07e3..1c16746 100644 --- a/src/edit/mod.rs +++ b/src/edit/mod.rs @@ -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; + fn copy_selection(&self) -> Option; /// 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 diff --git a/src/edit/syntect.rs b/src/edit/syntect.rs index 62e9352..8eda391 100644 --- a/src/edit/syntect.rs +++ b/src/edit/syntect.rs @@ -250,7 +250,7 @@ impl<'a> Edit for SyntaxEditor<'a> { self.editor.shape_as_needed(font_system); } - fn copy_selection(&mut self) -> Option { + fn copy_selection(&self) -> Option { self.editor.copy_selection() } diff --git a/src/edit/vi.rs b/src/edit/vi.rs index b0309aa..4d5fd89 100644 --- a/src/edit/vi.rs +++ b/src/edit/vi.rs @@ -81,7 +81,7 @@ impl<'a> Edit for ViEditor<'a> { self.editor.shape_as_needed(font_system); } - fn copy_selection(&mut self) -> Option { + fn copy_selection(&self) -> Option { self.editor.copy_selection() }