aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorWayne Rowcliffe <war1025@gmail.com>2014-08-20 19:39:05 -0500
committerWayne Rowcliffe <war1025@gmail.com>2014-09-08 17:27:41 -0500
commitac0b9714edbb7697b8324f922024401baea8953b (patch)
tree85449173705a443081b1189a9d1087df74030703 /src/nvim/ex_cmds.c
parentfe99930c46c096b9be277d3201b3ea9b5bf2f659 (diff)
downloadrneovim-ac0b9714edbb7697b8324f922024401baea8953b.tar.gz
rneovim-ac0b9714edbb7697b8324f922024401baea8953b.tar.bz2
rneovim-ac0b9714edbb7697b8324f922024401baea8953b.zip
Additional FOR_ALL_WINDOWS usage
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 18216f6924..b72d1941ec 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4610,19 +4610,19 @@ prepare_tagpreview (
bool undo_sync /* sync undo when leaving the window */
)
{
- win_T *wp;
-
-
/*
* If there is already a preview window open, use that one.
*/
if (!curwin->w_p_pvw) {
- for (wp = firstwin; wp != NULL; wp = wp->w_next)
- if (wp->w_p_pvw)
+ bool found_win = false;
+ FOR_ALL_WINDOWS(wp) {
+ if (wp->w_p_pvw) {
+ win_enter(wp, undo_sync);
+ found_win = true;
break;
- if (wp != NULL)
- win_enter(wp, undo_sync);
- else {
+ }
+ }
+ if (!found_win) {
/*
* There is no preview window open yet. Create one.
*/