aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/indent.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-02-19 05:55:53 +0000
committerBlaž Hrastnik2021-02-19 05:55:53 +0000
commit8c82f8f140f45a76414fa28e842aabfbeffa864e (patch)
tree141f2d541b9ea456b039c4da4d0e36143b643fda /helix-core/src/indent.rs
parent7a1ff5e45f829df17dfdcbd4923ae9e83fc2bf3f (diff)
indent: use_list indentation, fix indentation bug on open_below
use std::{ time::Duration // <- pressing `o` here would use }'s indent instead of prev line }
Diffstat (limited to 'helix-core/src/indent.rs')
-rw-r--r--helix-core/src/indent.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs
index 49552b4f..68d5d7b0 100644
--- a/helix-core/src/indent.rs
+++ b/helix-core/src/indent.rs
@@ -78,6 +78,8 @@ fn calculate_indentation(node: Option<Node>, newline: bool) -> usize {
"field_expression",
//
"where_clause",
+ //
+ "use_list",
];
let outdent = &["where", "}", "]", ")"];
@@ -213,6 +215,12 @@ mod test {
fn test_suggested_indent_for_line() {
let doc = Rope::from(
"
+use std::{
+ io::{self, stdout, Stdout, Write},
+ path::PathBuf,
+ sync::Arc,
+ time::Duration,
+}
mod test {
fn hello_world() {
1 + 1;