aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johanhelsing@gmail.com>2015-11-03 22:04:15 +0100
committerJohan Klokkhammer Helsing <johanhelsing@gmail.com>2015-12-13 13:06:48 +0100
commit3b472e55b327dc1c4fc034c665398e70d0f7dc77 (patch)
treeb6915ed824c3dffc6c16cf9e6bb79bff6ff47fca /src/nvim/edit.c
parentb0796227166698561506b686dbdf795675e09de1 (diff)
downloadrneovim-3b472e55b327dc1c4fc034c665398e70d0f7dc77.tar.gz
rneovim-3b472e55b327dc1c4fc034c665398e70d0f7dc77.tar.bz2
rneovim-3b472e55b327dc1c4fc034c665398e70d0f7dc77.zip
vim-patch:7.4.803
Problem: C indent does not support C11 raw strings. (Mark Lodato) Solution: Do not change indent inside the raw string. https://github.com/vim/vim/commit/f7bb86dc593913d055e4cce16cec43f6271adda3
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 9ba5d96e16..ceedcb5a99 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -6584,9 +6584,14 @@ static int cindent_on(void) {
*/
void fixthisline(IndentGetter get_the_indent)
{
- 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 fix_indent(void) {