Skip to content

Commit

Permalink
fix: Don't panic on Enter on an empty document.
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Jun 28, 2021
1 parent ca98210 commit 6214d70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6214d70

Please sign in to comment.