From 8c82f8f140f45a76414fa28e842aabfbeffa864e Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 19 Feb 2021 14:55:53 +0900 Subject: 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 } --- helix-core/src/indent.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'helix-core') 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, 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; -- cgit v1.2.3-70-g09d2