aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.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-term/src/commands.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-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 4fe80971..95c98b10 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -644,7 +644,7 @@ pub fn open_below(cx: &mut Context) {
let indent_level = helix_core::indent::suggested_indent_for_pos(
doc.syntax.as_ref(),
&doc.state,
- index,
+ index - 1, // need to match the indentation to the prev line
true,
);
let indent = " ".repeat(TAB_WIDTH).repeat(indent_level);