diff options
author | Wayne Rowcliffe <war1025@gmail.com> | 2014-08-23 12:03:14 -0500 |
---|---|---|
committer | Wayne Rowcliffe <war1025@gmail.com> | 2014-09-22 09:31:09 -0500 |
commit | 683bc797a0d427d818f69dd4772e149cf94e6b12 (patch) | |
tree | 8bc73873f033b5a37696168c0ddc165869822770 /src/nvim/buffer.c | |
parent | b4ec6c1a4bacd6eaef958e242310ffaee94805dd (diff) | |
download | rneovim-683bc797a0d427d818f69dd4772e149cf94e6b12.tar.gz rneovim-683bc797a0d427d818f69dd4772e149cf94e6b12.tar.bz2 rneovim-683bc797a0d427d818f69dd4772e149cf94e6b12.zip |
FOR_ALL_WINDOWS_IN_TAB and local variables in FOR_ALL_TAB_WINDOWS
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 11171617ef..4eff8df9f5 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -514,13 +514,9 @@ void buf_freeall(buf_T *buf, int flags) reset_synblock(curwin); /* No folds in an empty buffer. */ - { - win_T *win; - tabpage_T *tp; - - FOR_ALL_TAB_WINDOWS(tp, win) { - if (win->w_buffer == buf) - clearFolding(win); + FOR_ALL_TAB_WINDOWS(tp, win) { + if (win->w_buffer == buf) { + clearFolding(win); } } @@ -4206,8 +4202,6 @@ int read_viminfo_bufferlist(vir_T *virp, int writing) void write_viminfo_bufferlist(FILE *fp) { - win_T *win; - tabpage_T *tp; char_u *line; int max_buffers; @@ -4284,8 +4278,12 @@ char_u *buf_spname(buf_T *buf) */ bool find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp) { - FOR_ALL_TAB_WINDOWS(*tp, *wp) { - if ((*wp)->w_buffer == buf) { + *wp = NULL; + *tp = NULL; + FOR_ALL_TAB_WINDOWS(tp2, wp2) { + if (wp2->w_buffer == buf) { + *tp = tp2; + *wp = wp2; return true; } } |