From 3859f6963dfad2d2d09c979a8e6bb283bc5e2cb3 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Sat, 19 Sep 2020 11:55:15 +0900 Subject: More work on the UI. --- helix-core/src/state.rs | 5 +++++ helix-core/src/syntax.rs | 2 +- helix-core/src/transaction.rs | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'helix-core/src') diff --git a/helix-core/src/state.rs b/helix-core/src/state.rs index 150874b1..55ac5095 100644 --- a/helix-core/src/state.rs +++ b/helix-core/src/state.rs @@ -102,6 +102,11 @@ impl State { self.mode } + #[inline] + pub fn path(&self) -> Option<&PathBuf> { + self.path.as_ref() + } + // pub fn doc(&self, range: R) -> RopeSlice // where // R: std::ops::RangeBounds, diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index c0b67f5d..1eb15633 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -173,7 +173,7 @@ impl LanguageLayer { self.tree.as_ref().unwrap() } - fn parse<'a>( + fn parse( &mut self, parser: &mut Parser, config: &HighlightConfiguration, diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index ab32d5da..f6fbddf8 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -243,13 +243,13 @@ impl ChangeSet { let old_end = old_pos + len; match change { - Retain(_len) => { + Retain(_) => { if old_end > pos { return new_pos + (pos - old_pos); } new_pos += len; } - Delete(_len) => { + Delete(_) => { // a subsequent ins means a replace, consume it let ins = if let Some(Insert(s)) = iter.peek() { iter.next(); -- cgit v1.2.3-70-g09d2