From 998559464b681a3d7f2da67edecc70393eed17ad Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Wed, 24 Feb 2016 22:18:37 +0800 Subject: [PATCH] In C mode, insure indentation is correct when inserting newline at end of white lines. --- random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/random.c b/random.c index 89a0f51..8f7bb26 100644 --- a/random.c +++ b/random.c @@ -547,8 +547,8 @@ static int cinsert(void) cptr = &curwp->w_dotp->l_text[0]; /* check for a brace */ - tptr = curwp->w_doto - 1; - bracef = (cptr[tptr] == '{'); + tptr = curwp->w_doto ; + bracef = (tptr > 0) && (cptr[ tptr - 1] == '{') ; /* save the indent of the previous line */ i = 0;