summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--graphics/src/text/editor.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/graphics/src/text/editor.rs b/graphics/src/text/editor.rs
index b4d6819f..7b0ddec1 100644
--- a/graphics/src/text/editor.rs
+++ b/graphics/src/text/editor.rs
@@ -72,15 +72,18 @@ impl editor::Editor for Editor {
fn cursor(&self) -> editor::Cursor {
let internal = self.internal();
+ let cursor = internal.editor.cursor();
+ let buffer = internal.editor.buffer();
+
match internal.editor.select_opt() {
- Some(selection) => {
+ Some(selection)
+ if cursor.line != selection.line
+ || cursor.index != selection.index =>
+ {
// TODO
Cursor::Selection(vec![])
}
- None => {
- let cursor = internal.editor.cursor();
- let buffer = internal.editor.buffer();
-
+ _ => {
let lines_before_cursor: usize = buffer
.lines
.iter()