aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fold.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-09-08 20:50:44 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-09-08 20:50:44 -0400
commit9fa467a9b227243c9c534ae0df1bdaf8235551a0 (patch)
tree85449173705a443081b1189a9d1087df74030703 /src/nvim/fold.c
parent3f5482d3251b3bbdc7c4df8a8e64eb3af7e5922c (diff)
parentac0b9714edbb7697b8324f922024401baea8953b (diff)
downloadrneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.tar.gz
rneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.tar.bz2
rneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.zip
Merge pull request #1096 from war1025/dev/local_for_all_windows
Convert FOR_ALL_WINDOWS to use a locally declared pointer
Diffstat (limited to 'src/nvim/fold.c')
-rw-r--r--src/nvim/fold.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index f65bbc0875..186e75981e 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -460,13 +460,10 @@ void newFoldLevel(void)
newFoldLevelWin(curwin);
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) {
- win_T *wp;
-
/*
* Set the same foldlevel in other windows in diff mode.
*/
- FOR_ALL_WINDOWS(wp)
- {
+ FOR_ALL_WINDOWS(wp) {
if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) {
wp->w_p_fdl = curwin->w_p_fdl;
newFoldLevelWin(wp);
@@ -1140,19 +1137,18 @@ setManualFold (
)
{
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) {
- win_T *wp;
linenr_T dlnum;
/*
* Do the same operation in other windows in diff mode. Calculate the
* line number from the diffs.
*/
- FOR_ALL_WINDOWS(wp)
- {
+ FOR_ALL_WINDOWS(wp) {
if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) {
dlnum = diff_lnum_win(curwin->w_cursor.lnum, wp);
- if (dlnum != 0)
+ if (dlnum != 0) {
(void)setManualFoldWin(wp, dlnum, opening, recurse, NULL);
+ }
}
}
}