aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/indent.rs
diff options
context:
space:
mode:
authorNathan Vegdahl2021-07-02 02:37:28 +0000
committerNathan Vegdahl2021-07-02 02:37:28 +0000
commit2224a1527ec9592f16131b0aa3923fc3d37592e7 (patch)
tree2a08b053cb32cef9dc1db5895778d419ebaebb5b /helix-core/src/indent.rs
parente725957704274b1ec814a34ddf6f75faf35358e7 (diff)
parent9f62ad0715240156b512dfc7c584d2d0df05a664 (diff)
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
Diffstat (limited to 'helix-core/src/indent.rs')
-rw-r--r--helix-core/src/indent.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs
index 8e0379e2..81bdffc0 100644
--- a/helix-core/src/indent.rs
+++ b/helix-core/src/indent.rs
@@ -1,13 +1,13 @@
use crate::{
find_first_non_whitespace_char,
syntax::{IndentQuery, LanguageConfiguration, Syntax},
- tree_sitter::{Node, Tree},
- Rope, RopeSlice,
+ tree_sitter::Node,
+ RopeSlice,
};
/// To determine indentation of a newly inserted line, figure out the indentation at the last col
/// of the previous line.
-
+#[allow(dead_code)]
fn indent_level_for_line(line: RopeSlice, tab_width: usize) -> usize {
let mut len = 0;
for ch in line.chars() {
@@ -98,12 +98,13 @@ fn calculate_indentation(query: &IndentQuery, node: Option<Node>, newline: bool)
increment as usize
}
+#[allow(dead_code)]
fn suggested_indent_for_line(
language_config: &LanguageConfiguration,
syntax: Option<&Syntax>,
text: RopeSlice,
line_num: usize,
- tab_width: usize,
+ _tab_width: usize,
) -> usize {
if let Some(start) = find_first_non_whitespace_char(text.line(line_num)) {
return suggested_indent_for_pos(
@@ -150,6 +151,7 @@ pub fn suggested_indent_for_pos(
#[cfg(test)]
mod test {
use super::*;
+ use crate::Rope;
#[test]
fn test_indent_level() {