diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-28 22:55:08 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-28 23:44:36 -0400 |
commit | d6b31721bfadabf5eaa817321706d403ecfbf805 (patch) | |
tree | d01e9813023327387ab0d9a71d43633519cf297a | |
parent | b388f462669199386a967afba6e299a033d37833 (diff) | |
download | rneovim-d6b31721bfadabf5eaa817321706d403ecfbf805.tar.gz rneovim-d6b31721bfadabf5eaa817321706d403ecfbf805.tar.bz2 rneovim-d6b31721bfadabf5eaa817321706d403ecfbf805.zip |
vim-patch:8.1.1086: too many curly braces
Problem: Too many curly braces.
Solution: Remove curly braces where they are not needed. (Hirohito Higashi,
closes vim/vim#3982)
https://github.com/vim/vim/commit/abab0b0fdd6535969447b03a4fffc1947918cf6c
Neovim code style requires the opposite.
Add curly braces to minimize lint errors when applying Vim patches.
-rw-r--r-- | src/nvim/ex_docmd.c | 5 | ||||
-rw-r--r-- | src/nvim/macros.h | 6 | ||||
-rw-r--r-- | src/nvim/move.c | 8 | ||||
-rw-r--r-- | src/nvim/ops.c | 4 |
4 files changed, 14 insertions, 9 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 5365270e0b..0db148690f 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6761,8 +6761,9 @@ void ex_splitview(exarg_T *eap) if (*eap->arg != NUL ) { RESET_BINDING(curwin); - } else - do_check_scrollbind(FALSE); + } else { + do_check_scrollbind(false); + } do_exedit(eap, old_curwin); } diff --git a/src/nvim/macros.h b/src/nvim/macros.h index c758e000a9..f0c0bc2bc3 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -127,7 +127,11 @@ # define MB_CHAR2LEN(c) mb_char2len(c) # define PTR2CHAR(p) utf_ptr2char(p) -# define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE +# define RESET_BINDING(wp) \ + do { \ + (wp)->w_p_scb = false; \ + (wp)->w_p_crb = false; \ + } while (0) /// Calculate the length of a C array /// diff --git a/src/nvim/move.c b/src/nvim/move.c index b9c4196251..4a87f82eb7 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -1245,12 +1245,12 @@ static void botline_forw(lineoff_T *lp) } else { ++lp->lnum; lp->fill = 0; - if (lp->lnum > curbuf->b_ml.ml_line_count) + if (lp->lnum > curbuf->b_ml.ml_line_count) { lp->height = MAXCOL; - else if (hasFolding(lp->lnum, NULL, &lp->lnum)) - /* Add a closed fold */ + } else if (hasFolding(lp->lnum, NULL, &lp->lnum)) { + // Add a closed fold lp->height = 1; - else { + } else { lp->height = plines_nofill(lp->lnum); } } diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 6709e52679..35ab9c4d84 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -2519,9 +2519,9 @@ static void op_yank_reg(oparg_T *oap, bool message, yankreg_T *reg, bool append) endcol = (colnr_T)STRLEN(p); if (startcol > endcol || is_oneChar - ) + ) { bd.textlen = 0; - else { + } else { bd.textlen = endcol - startcol + oap->inclusive; } bd.textstart = p + startcol; |