Mercurial > vim
diff src/gui_mac.c @ 9649:fd9727ae3c49 v7.4.2101
commit https://github.com/vim/vim/commit/2932359000b2f918d5fade79ea4d124d5943cd07
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 24 22:04:11 2016 +0200
patch 7.4.2101
Problem: Looping over windows, buffers and tab pages is inconsistant.
Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 24 Jul 2016 22:15:07 +0200 |
parents | 0c7f47088e55 |
children | 989d44d35a66 |
line wrap: on
line diff
--- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -633,7 +633,7 @@ Handle_KAHL_SRCH_AE( if (error) return error; - for (buf = firstbuf; buf != NULL; buf = buf->b_next) + FOR_ALL_BUFFERS(buf) if (buf->b_ml.ml_mfp != NULL && SearchData.theFile.parID == buf->b_FSSpec.parID && SearchData.theFile.name[0] == buf->b_FSSpec.name[0] @@ -725,7 +725,7 @@ Handle_KAHL_MOD_AE( #endif numFiles = 0; - for (buf = firstbuf; buf != NULL; buf = buf->b_next) + FOR_ALL_BUFFERS(buf) if (buf->b_ml.ml_mfp != NULL) { /* Add this file to the list */ @@ -807,7 +807,7 @@ Handle_KAHL_GTTX_AE( if (error) return error; - for (buf = firstbuf; buf != NULL; buf = buf->b_next) + FOR_ALL_BUFFERS(buf) if (buf->b_ml.ml_mfp != NULL) if (GetTextData.theFile.parID == buf->b_FSSpec.parID) { @@ -6422,7 +6422,7 @@ getTabCount(void) tabpage_T *tp; int numTabs = 0; - for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) + FOR_ALL_TABPAGES(tp) ++numTabs; return numTabs; }