diff options
author | Wayne Rowcliffe <war1025@gmail.com> | 2014-08-22 22:40:49 -0500 |
---|---|---|
committer | Wayne Rowcliffe <war1025@gmail.com> | 2014-09-22 09:26:40 -0500 |
commit | b4ec6c1a4bacd6eaef958e242310ffaee94805dd (patch) | |
tree | 114630b22cd9abbfbda3349fd91e37f3f116a277 /src/nvim/screen.c | |
parent | a4b9e0df67ae95777f8f7d833e7d4c6b8fc3840c (diff) | |
download | rneovim-b4ec6c1a4bacd6eaef958e242310ffaee94805dd.tar.gz rneovim-b4ec6c1a4bacd6eaef958e242310ffaee94805dd.tar.bz2 rneovim-b4ec6c1a4bacd6eaef958e242310ffaee94805dd.zip |
FOR_ALL_TABS helper
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 122c23ed84..327f39f096 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -7632,7 +7632,6 @@ void unshowmode(int force) static void draw_tabline(void) { int tabcount = 0; - tabpage_T *tp; int tabwidth; int col = 0; int scol = 0; @@ -7675,8 +7674,9 @@ static void draw_tabline(void) (char_u *)"", OPT_FREE, SID_ERROR); called_emsg |= save_called_emsg; } else { - for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) + FOR_ALL_TABS(tp) { ++tabcount; + } tabwidth = (Columns - 1 + tabcount / 2) / tabcount; if (tabwidth < 6) @@ -7685,8 +7685,12 @@ static void draw_tabline(void) attr = attr_nosel; tabcount = 0; scol = 0; - for (tp = first_tabpage; tp != NULL && col < Columns - 4; - tp = tp->tp_next) { + + FOR_ALL_TABS(tp) { + if (col >= Columns - 4) { + break; + } + scol = col; if (tp->tp_topframe == topframe) |