diff options
author | Wayne Rowcliffe <war1025@gmail.com> | 2014-08-02 17:10:42 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-08-07 00:42:13 -0400 |
commit | 3599a834d5b731d3b24767e3645b39290042b60c (patch) | |
tree | 73980e91e49b3d6a0097546cc00a3a15555beec0 /src | |
parent | 8fa4abf15a9898ee185b71b9a9a746c82b50a1b0 (diff) | |
download | rneovim-3599a834d5b731d3b24767e3645b39290042b60c.tar.gz rneovim-3599a834d5b731d3b24767e3645b39290042b60c.tar.bz2 rneovim-3599a834d5b731d3b24767e3645b39290042b60c.zip |
Return bool from find_win_for_buf #1023
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/buffer.c | 2 | ||||
-rw-r--r-- | src/nvim/buffer.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 21bfc5ede0..a268e04559 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -490,7 +490,7 @@ static void switch_to_win_for_buf(buf_T *buf, win_T *wp; tabpage_T *tp; - if (find_win_for_buf(buf, &wp, &tp) == FAIL + if (!find_win_for_buf(buf, &wp, &tp) || switch_win(save_curwinp, save_curtabp, wp, tp, true) == FAIL) switch_buffer(save_curbufp, buf); } diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index a1efc98516..ee2b1ecf1d 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -4246,7 +4246,7 @@ char_u *buf_spname(buf_T *buf) * For location list window, w_llist_ref points to the location list. * For quickfix window, w_llist_ref is NULL. */ - if (find_win_for_buf(buf, &win, &tp) == OK && win->w_llist_ref != NULL) + if (find_win_for_buf(buf, &win, &tp) && win->w_llist_ref != NULL) return (char_u *)_(msg_loclist); else return (char_u *)_(msg_qflist); @@ -4265,17 +4265,17 @@ char_u *buf_spname(buf_T *buf) /* * Find a window for buffer "buf". - * If found OK is returned and "wp" and "tp" are set to the window and tabpage. - * If not found FAIL is returned. + * If found true is returned and "wp" and "tp" are set to the window and tabpage. + * If not found false is returned. */ -int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp) +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) { - return OK; + return true; } } - return FAIL; + return false; } /* |