on master help sign in
cargo fmt & clippy lint
commit9546164dc89515719d4781699e1505b2a50486ef authorBlaž Hrastnik <blaz@mxxn.io> dateSat 12 Sep 2020, 19:36 (6 years ago) parentee43053
3 files changed+19−21
helix-core/src/lib.rs+1−1 helix-core/src/syntax.rs+17−19 helix-term/src/editor.rs+1−1
helix-core/src/lib.rs+1−1
@@ -1,9 +1,9 @@
11#![allow(unused)]
22pub mod commands;
33pub mod graphemes;
4−pub mod syntax;
54mod selection;
65pub mod state;
6+pub mod syntax;
77mod transaction;
88
99pub use ropey::{Rope, RopeSlice};
helix-core/src/syntax.rs+17−19
@@ -859,26 +859,24 @@ where
859859 }
860860 // If the node represents a reference, then try to find the corresponding
861861 // definition in the scope stack.
862− else if Some(capture.index) == layer.config.local_ref_capture_index {
863− if definition_highlight.is_none() {
864− definition_highlight = None;
865− if let Ok(name) = str::from_utf8(&self.source[range.clone()]) {
866− for scope in layer.scope_stack.iter().rev() {
867− if let Some(highlight) =
868− scope.local_defs.iter().rev().find_map(|def| {
869− if def.name == name && range.start >= def.value_range.end {
870− Some(def.highlight)
871− } else {
872− None
873− }
874− })
875− {
876− reference_highlight = highlight;
877− break;
878− }
879− if !scope.inherits {
880− break;
862+ else if Some(capture.index) == layer.config.local_ref_capture_index
863+ && definition_highlight.is_none()
864+ {
865+ definition_highlight = None;
866+ if let Ok(name) = str::from_utf8(&self.source[range.clone()]) {
867+ for scope in layer.scope_stack.iter().rev() {
868+ if let Some(highlight) = scope.local_defs.iter().rev().find_map(|def| {
869+ if def.name == name && range.start >= def.value_range.end {
870+ Some(def.highlight)
871+ } else {
872+ None
881873 }
874+ }) {
875+ reference_highlight = highlight;
876+ break;
877+ }
878+ if !scope.inherits {
879+ break;
882880 }
883881 }
884882 }
helix-term/src/editor.rs+1−1
@@ -1,8 +1,8 @@
11use crate::{keymap, theme::Theme, Args};
22use helix_core::{
3− syntax::{HighlightConfiguration, HighlightEvent, Highlighter},
43 state::coords_at_pos,
54 state::Mode,
5+ syntax::{HighlightConfiguration, HighlightEvent, Highlighter},
66 State,
77};
88