summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/vi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/vi.c b/editors/vi.c
index ba608fb..3daa075 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2147,7 +2147,7 @@ static char *char_insert(char *p, char c, int undo) // insert the char c at 'p'
#if ENABLE_FEATURE_VI_SETOPTS
if (autoindent) {
len = indent_len(bol);
- if (len && get_column(bol + len) == indentcol) {
+ if (len && get_column(bol + len) == indentcol && bol[len] == '\n') {
// remove autoindent from otherwise empty line
text_hole_delete(bol, bol + len - 1, undo);
p = bol;