aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-09-12 10:36:49 +0000
committerBlaž Hrastnik2020-09-12 10:38:30 +0000
commit9546164dc89515719d4781699e1505b2a50486ef (patch)
tree1fdce9e3cd9ed26f80d9fcab60f9bd3e8a5aa8ef
parentee430536a43bb7b51cd857d43a3c9279845b107b (diff)
cargo fmt & clippy lint
-rw-r--r--helix-core/src/lib.rs2
-rw-r--r--helix-core/src/syntax.rs36
-rw-r--r--helix-term/src/editor.rs2
3 files changed, 19 insertions, 21 deletions
diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs
index f593dcfb..069dc116 100644
--- a/helix-core/src/lib.rs
+++ b/helix-core/src/lib.rs
@@ -1,9 +1,9 @@
#![allow(unused)]
pub mod commands;
pub mod graphemes;
-pub mod syntax;
mod selection;
pub mod state;
+pub mod syntax;
mod transaction;
pub use ropey::{Rope, RopeSlice};
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 8a4ad519..b936ecd3 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -859,26 +859,24 @@ where
}
// If the node represents a reference, then try to find the corresponding
// definition in the scope stack.
- else if Some(capture.index) == layer.config.local_ref_capture_index {
- if definition_highlight.is_none() {
- definition_highlight = None;
- if let Ok(name) = str::from_utf8(&self.source[range.clone()]) {
- for scope in layer.scope_stack.iter().rev() {
- if let Some(highlight) =
- scope.local_defs.iter().rev().find_map(|def| {
- if def.name == name && range.start >= def.value_range.end {
- Some(def.highlight)
- } else {
- None
- }
- })
- {
- reference_highlight = highlight;
- break;
- }
- if !scope.inherits {
- break;
+ else if Some(capture.index) == layer.config.local_ref_capture_index
+ && definition_highlight.is_none()
+ {
+ definition_highlight = None;
+ if let Ok(name) = str::from_utf8(&self.source[range.clone()]) {
+ for scope in layer.scope_stack.iter().rev() {
+ if let Some(highlight) = scope.local_defs.iter().rev().find_map(|def| {
+ if def.name == name && range.start >= def.value_range.end {
+ Some(def.highlight)
+ } else {
+ None
}
+ }) {
+ reference_highlight = highlight;
+ break;
+ }
+ if !scope.inherits {
+ break;
}
}
}
diff --git a/helix-term/src/editor.rs b/helix-term/src/editor.rs
index 0c58ac9b..03008221 100644
--- a/helix-term/src/editor.rs
+++ b/helix-term/src/editor.rs
@@ -1,8 +1,8 @@
use crate::{keymap, theme::Theme, Args};
use helix_core::{
- syntax::{HighlightConfiguration, HighlightEvent, Highlighter},
state::coords_at_pos,
state::Mode,
+ syntax::{HighlightConfiguration, HighlightEvent, Highlighter},
State,
};