aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 688e653a..f6511ba5 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -2511,7 +2511,7 @@ pub mod insert {
} else {
contents.char(pos - 1)
};
- let curr = contents.char(pos);
+ let curr = contents.get_char(pos).unwrap_or(' ');
// TODO: offset range.head by 1? when calculating?
let indent_level = indent::suggested_indent_for_pos(