diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-06-25 22:38:13 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-06-26 00:05:29 -0400 |
commit | 2d6c91ab9954c2f3be27c7eefaaa498d91e557be (patch) | |
tree | 1054c05c02082f0426e6d539dab40879c57e7f16 /src/nvim/screen.c | |
parent | 62c7fcbdab28589b0efff03d7b26408362514a19 (diff) | |
download | rneovim-2d6c91ab9954c2f3be27c7eefaaa498d91e557be.tar.gz rneovim-2d6c91ab9954c2f3be27c7eefaaa498d91e557be.tar.bz2 rneovim-2d6c91ab9954c2f3be27c7eefaaa498d91e557be.zip |
vim-patch:8.0.1688: some macros are used without a semicolon
Problem: Some macros are used without a semicolon, causing auto-indent to be
wrong.
Solution: Use the do-while(0) trick. (Ozaki Kiichi, closes vim/vim#2729)
https://github.com/vim/vim/commit/6f4700233fd925fe122b851f937929fb5e5da707
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index d91b832e5a..d141520fef 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1709,7 +1709,6 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T int col; int txtcol; int off; - int ri; /* Build the fold line: * 1. Add the cmdwin_type for the command-line window @@ -1753,15 +1752,18 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T col += fdc; } -# define RL_MEMSET(p, v, l) if (wp->w_p_rl) { \ - for (ri = 0; ri < l; ri++) { \ - linebuf_attr[off + (wp->w_grid.Columns - (p) - (l)) + ri] = v; \ +# define RL_MEMSET(p, v, l) \ + do { \ + if (wp->w_p_rl) { \ + for (int ri = 0; ri < l; ri++) { \ + linebuf_attr[off + (wp->w_grid.Columns - (p) - (l)) + ri] = v; \ + } \ + } else { \ + for (int ri = 0; ri < l; ri++) { \ + linebuf_attr[off + (p) + ri] = v; \ + } \ } \ - } else { \ - for (ri = 0; ri < l; ri++) { \ - linebuf_attr[off + (p) + ri] = v; \ - } \ - } + } while (0) /* Set all attributes of the 'number' or 'relativenumber' column and the * text */ |