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 {
|
fn cursor(&self) -> editor::Cursor {
|
||||||
let internal = self.internal();
|
let internal = self.internal();
|
||||||
|
|
||||||
|
let cursor = internal.editor.cursor();
|
||||||
|
let buffer = internal.editor.buffer();
|
||||||
|
|
||||||
match internal.editor.select_opt() {
|
match internal.editor.select_opt() {
|
||||||
Some(selection) => {
|
Some(selection)
|
||||||
|
if cursor.line != selection.line
|
||||||
|
|| cursor.index != selection.index =>
|
||||||
|
{
|
||||||
// TODO
|
// TODO
|
||||||
Cursor::Selection(vec![])
|
Cursor::Selection(vec![])
|
||||||
}
|
}
|
||||||
None => {
|
_ => {
|
||||||
let cursor = internal.editor.cursor();
|
|
||||||
let buffer = internal.editor.buffer();
|
|
||||||
|
|
||||||
let lines_before_cursor: usize = buffer
|
let lines_before_cursor: usize = buffer
|
||||||
.lines
|
.lines
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue