From 7c99ff58fdc4c5217f86e59d2b3ec0df10f79aaa Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Tue, 19 Jan 2021 16:16:15 +0900 Subject: nix: include rust-src so rust-analyzer works correctly. --- helix-core/src/indent.rs | 4 ++-- helix-core/src/position.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'helix-core/src') diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs index d75038d2..e708b317 100644 --- a/helix-core/src/indent.rs +++ b/helix-core/src/indent.rs @@ -135,8 +135,8 @@ fn calculate_indentation(node: Option, newline: bool) -> usize { // let len = 1; // }) - if ((indent_scopes.contains(&parent_kind) && true) // not_first_or_last_sibling - || (indent_except_first_scopes.contains(&parent_kind) && true)) + if (indent_scopes.contains(&parent_kind) // && not_first_or_last_sibling + || indent_except_first_scopes.contains(&parent_kind)) && !starts_same_line { // println!("is_scope {}", parent_kind); diff --git a/helix-core/src/position.rs b/helix-core/src/position.rs index 8bc48094..5e5f902b 100644 --- a/helix-core/src/position.rs +++ b/helix-core/src/position.rs @@ -39,9 +39,9 @@ impl From<(usize, usize)> for Position { } } -impl Into for Position { - fn into(self) -> tree_sitter::Point { - tree_sitter::Point::new(self.row, self.col) +impl From for tree_sitter::Point { + fn from(pos: Position) -> Self { + Self::new(pos.row, pos.col) } } -- cgit v1.2.3-70-g09d2