Return Cursor::Caret if selection matches cursor position in Editor::cursor
This commit is contained in:
parent
1455911b63
commit
abab144857
1 changed files with 8 additions and 5 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue