summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-07-28 21:17:36 +0200
committerBram Moolenaar <Bram@vim.org>2015-07-28 21:17:36 +0200
commitf7bb86dc593913d055e4cce16cec43f6271adda3 (patch)
treed987f51511bb7af5395ea9adcc467b0a33660dd3 /src/edit.c
parent52e21cf057e313a867b0f529c8e4d52ad5ae740d (diff)
downloadvim-git-f7bb86dc593913d055e4cce16cec43f6271adda3.tar.gz
patch 7.4.803v7.4.803
Problem: C indent does not support C11 raw strings. (Mark Lodato) Solution: Do not change indent inside the raw string.
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/edit.c b/src/edit.c
index 5d3bd8279..b48a2176f 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -7813,9 +7813,14 @@ cindent_on()
fixthisline(get_the_indent)
int (*get_the_indent) __ARGS((void));
{
- change_indent(INDENT_SET, get_the_indent(), FALSE, 0, TRUE);
- if (linewhite(curwin->w_cursor.lnum))
- did_ai = TRUE; /* delete the indent if the line stays empty */
+ int amount = get_the_indent();
+
+ if (amount >= 0)
+ {
+ change_indent(INDENT_SET, amount, FALSE, 0, TRUE);
+ if (linewhite(curwin->w_cursor.lnum))
+ did_ai = TRUE; /* delete the indent if the line stays empty */
+ }
}
void