@@ -106,8 +106,11 @@ fn calculate_indentation(node: Option<Node>, newline: bool) -> usize {
106106 let parent_kind = parent.kind();
107107 let start = parent.start_position().row;
108108
109− // println!(
110− // "name: {}\tparent: {}\trange:\t{} {}\tfirst={:?}\tlast={:?} start={} prev={}",
109+ // detect deeply nested indents in the same line
110+ let starts_same_line = start == prev_start;
111+
112+ // log::error!(
113+ // "name: {}\tparent: {}\trange:\t{} {}\tfirst={:?}\tlast={:?} start={} prev={} same_line={}",
111114 // node.kind(),
112115 // parent.kind(),
113116 // node.range().start_point,
@@ -116,14 +119,11 @@ fn calculate_indentation(node: Option<Node>, newline: bool) -> usize {
116119 // node.next_sibling().is_none(),
117120 // node.start_position(),
118121 // prev_start,
122+ // starts_same_line
119123 // );
120124
121− // detect deeply nested indents in the same line
122− let starts_same_line = start == prev_start;
123−
124− if outdent.contains(&node.kind()) {
125+ if outdent.contains(&node.kind()) && !starts_same_line {
125126 // we outdent by skipping the rules for the current level and jumping up
126− // println!("skipping..");
127127 // node = parent;
128128 increment -= 1;
129129 // continue;