Support line selection

This commit is contained in:
Jeremy Soller 2023-11-28 10:42:50 -07:00
parent 9a975ad79a
commit cbd567d238
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
6 changed files with 118 additions and 142 deletions

View file

@ -9,7 +9,7 @@ use syntect::parsing::{ParseState, ScopeStack, SyntaxReference, SyntaxSet};
use crate::{
Action, AttrsList, BorrowedWithFontSystem, Buffer, Change, Color, Cursor, Edit, Editor,
FontSystem, Shaping, Style, Weight, Wrap,
FontSystem, Selection, Shaping, Style, Weight, Wrap,
};
pub use syntect::highlighting::Theme as SyntaxTheme;
@ -158,12 +158,12 @@ impl<'a> Edit for SyntaxEditor<'a> {
self.editor.set_cursor(cursor);
}
fn select_opt(&self) -> Option<Cursor> {
self.editor.select_opt()
fn selection(&self) -> Selection {
self.editor.selection()
}
fn set_select_opt(&mut self, select_opt: Option<Cursor>) {
self.editor.set_select_opt(select_opt);
fn set_selection(&mut self, selection: Selection) {
self.editor.set_selection(selection);
}
fn auto_indent(&self) -> bool {