Mercurial > vim
comparison src/window.c @ 10357:59d01e335858 v8.0.0073
commit https://github.com/vim/vim/commit/459ca563128f2edb7e3bb190090bbb755a56dd55
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 10 18:16:33 2016 +0100
patch 8.0.0073
Problem: More comparisons between firstwin and lastwin.
Solution: Use ONE_WINDOW for consistency. (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 10 Nov 2016 18:30:05 +0100 |
parents | cf988222b150 |
children | 66f1b5bf3fa6 |
comparison
equal
deleted
inserted
replaced
10356:49b1b87c4802 | 10357:59d01e335858 |
---|---|
789 oldwin = lastwin; | 789 oldwin = lastwin; |
790 else | 790 else |
791 oldwin = curwin; | 791 oldwin = curwin; |
792 | 792 |
793 /* add a status line when p_ls == 1 and splitting the first window */ | 793 /* add a status line when p_ls == 1 and splitting the first window */ |
794 if (lastwin == firstwin && p_ls == 1 && oldwin->w_status_height == 0) | 794 if (ONE_WINDOW && p_ls == 1 && oldwin->w_status_height == 0) |
795 { | 795 { |
796 if (oldwin->w_height <= p_wmh && new_wp == NULL) | 796 if (oldwin->w_height <= p_wmh && new_wp == NULL) |
797 { | 797 { |
798 EMSG(_(e_noroom)); | 798 EMSG(_(e_noroom)); |
799 return FAIL; | 799 return FAIL; |
1490 frame_T *frp2; | 1490 frame_T *frp2; |
1491 win_T *wp; | 1491 win_T *wp; |
1492 win_T *wp2; | 1492 win_T *wp2; |
1493 int temp; | 1493 int temp; |
1494 | 1494 |
1495 if (lastwin == firstwin) /* just one window */ | 1495 if (ONE_WINDOW) /* just one window */ |
1496 { | 1496 { |
1497 beep_flush(); | 1497 beep_flush(); |
1498 return; | 1498 return; |
1499 } | 1499 } |
1500 | 1500 |
1672 win_totop(int size, int flags) | 1672 win_totop(int size, int flags) |
1673 { | 1673 { |
1674 int dir; | 1674 int dir; |
1675 int height = curwin->w_height; | 1675 int height = curwin->w_height; |
1676 | 1676 |
1677 if (lastwin == firstwin) | 1677 if (ONE_WINDOW) |
1678 { | 1678 { |
1679 beep_flush(); | 1679 beep_flush(); |
1680 return; | 1680 return; |
1681 } | 1681 } |
1682 | 1682 |
2121 int count = tabpage_index(NULL); | 2121 int count = tabpage_index(NULL); |
2122 #endif | 2122 #endif |
2123 | 2123 |
2124 ++RedrawingDisabled; | 2124 ++RedrawingDisabled; |
2125 | 2125 |
2126 for (wp = firstwin; wp != NULL && lastwin != firstwin; ) | 2126 for (wp = firstwin; wp != NULL && !ONE_WINDOW; ) |
2127 { | 2127 { |
2128 if (wp->w_buffer == buf && (!keep_curwin || wp != curwin) | 2128 if (wp->w_buffer == buf && (!keep_curwin || wp != curwin) |
2129 #ifdef FEAT_AUTOCMD | 2129 #ifdef FEAT_AUTOCMD |
2130 && !(wp->w_closing || wp->w_buffer->b_locked > 0) | 2130 && !(wp->w_closing || wp->w_buffer->b_locked > 0) |
2131 #endif | 2131 #endif |
3371 } | 3371 } |
3372 win_close(wp, !P_HID(wp->w_buffer) && !bufIsChanged(wp->w_buffer)); | 3372 win_close(wp, !P_HID(wp->w_buffer) && !bufIsChanged(wp->w_buffer)); |
3373 } | 3373 } |
3374 } | 3374 } |
3375 | 3375 |
3376 if (message && lastwin != firstwin) | 3376 if (message && !ONE_WINDOW) |
3377 EMSG(_("E445: Other window contains changes")); | 3377 EMSG(_("E445: Other window contains changes")); |
3378 } | 3378 } |
3379 | 3379 |
3380 #endif /* FEAT_WINDOWS */ | 3380 #endif /* FEAT_WINDOWS */ |
3381 | 3381 |
5969 last_status( | 5969 last_status( |
5970 int morewin) /* pretend there are two or more windows */ | 5970 int morewin) /* pretend there are two or more windows */ |
5971 { | 5971 { |
5972 /* Don't make a difference between horizontal or vertical split. */ | 5972 /* Don't make a difference between horizontal or vertical split. */ |
5973 last_status_rec(topframe, (p_ls == 2 | 5973 last_status_rec(topframe, (p_ls == 2 |
5974 || (p_ls == 1 && (morewin || lastwin != firstwin)))); | 5974 || (p_ls == 1 && (morewin || !ONE_WINDOW)))); |
5975 } | 5975 } |
5976 | 5976 |
5977 static void | 5977 static void |
5978 last_status_rec(frame_T *fr, int statusline) | 5978 last_status_rec(frame_T *fr, int statusline) |
5979 { | 5979 { |