Hi Bram,

FOR_ALL_TAB_WINDOWS() macro contain the double for-loop.
So that, 'break' can not escape this.
I checkd out all the places that using.
I found an appropriate place in aucmd_restbuf().
(Not bug, but occurred wasted loop)
I fixed this and added comment to FOR_ALL_TAB_WINDOWS().

Below is patch. Please check this.

Regards
--
Hirohito Higashi

diff -r 9140571d01ab src/fileio.c
--- a/src/fileio.c Mon Feb 06 00:13:22 2012 +0100
+++ b/src/fileio.c Mon Feb 06 15:20:54 2012 +0900
@@ -8898,10 +8898,11 @@
     if (tp != curtab)
  goto_tabpage_tp(tp);
     win_goto(aucmd_win);
-    break;
+    goto win_found;
  }
     }
  }
+win_found:
 
  /* Remove the window and frame from the tree of frames. */
  (void)winframe_remove(curwin, &dummy, NULL);
diff -r 9140571d01ab src/globals.h
--- a/src/globals.h Mon Feb 06 00:13:22 2012 +0100
+++ b/src/globals.h Mon Feb 06 15:20:54 2012 +0900
@@ -535,6 +535,10 @@
 EXTERN win_T *prevwin INIT(= NULL); /* previous window */
 # define W_NEXT(wp) ((wp)->w_next)
 # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = 
wp->w_next)
+/*
+ * When use this macro, You should NOT use 'break'. Should use 'goto'.
+ * 'break' can not escape the double for-loop.
+ */
 # define FOR_ALL_TAB_WINDOWS(tp, wp) \
     for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
  for ((wp) = ((tp) == curtab) \

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui