Mercurial > vim
comparison src/popupmnu.c @ 12477:68d7bc045dbe v8.0.1118
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
commit https://github.com/vim/vim/commit/4033c55eca575777718c0701e26635a0cc47d907
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 16 20:54:51 2017 +0200
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
Problem: FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
enabled and only adds 7% to the binary size of the tiny build.
Solution: Graduate FEAT_WINDOWS.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Sep 2017 21:00:06 +0200 |
parents | 506f5d8b7d8b |
children | 3ca08bf99396 |
comparison
equal
deleted
inserted
replaced
12476:2516383741e6 | 12477:68d7bc045dbe |
---|---|
58 int context_lines; | 58 int context_lines; |
59 int col; | 59 int col; |
60 int above_row; | 60 int above_row; |
61 int below_row; | 61 int below_row; |
62 int redo_count = 0; | 62 int redo_count = 0; |
63 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 63 #if defined(FEAT_QUICKFIX) |
64 win_T *pvwin; | 64 win_T *pvwin; |
65 #endif | 65 #endif |
66 | 66 |
67 redo: | 67 redo: |
68 def_width = PUM_DEF_WIDTH; | 68 def_width = PUM_DEF_WIDTH; |
78 validate_cursor_col(); | 78 validate_cursor_col(); |
79 pum_array = NULL; | 79 pum_array = NULL; |
80 | 80 |
81 row = curwin->w_wrow + W_WINROW(curwin); | 81 row = curwin->w_wrow + W_WINROW(curwin); |
82 | 82 |
83 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 83 #if defined(FEAT_QUICKFIX) |
84 FOR_ALL_WINDOWS(pvwin) | 84 FOR_ALL_WINDOWS(pvwin) |
85 if (pvwin->w_p_pvw) | 85 if (pvwin->w_p_pvw) |
86 break; | 86 break; |
87 if (pvwin != NULL) | 87 if (pvwin != NULL) |
88 { | 88 { |
154 | 154 |
155 /* don't display when we only have room for one line */ | 155 /* don't display when we only have room for one line */ |
156 if (pum_height < 1 || (pum_height == 1 && size > 1)) | 156 if (pum_height < 1 || (pum_height == 1 && size > 1)) |
157 return; | 157 return; |
158 | 158 |
159 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 159 #if defined(FEAT_QUICKFIX) |
160 /* If there is a preview window at the above avoid drawing over it. */ | 160 /* If there is a preview window at the above avoid drawing over it. */ |
161 if (pvwin != NULL && pum_row < above_row && pum_height > above_row) | 161 if (pvwin != NULL && pum_row < above_row && pum_height > above_row) |
162 { | 162 { |
163 pum_row += above_row; | 163 pum_row += above_row; |
164 pum_height -= above_row; | 164 pum_height -= above_row; |
549 /* scroll up */ | 549 /* scroll up */ |
550 pum_first = pum_selected + context - pum_height + 1; | 550 pum_first = pum_selected + context - pum_height + 1; |
551 } | 551 } |
552 } | 552 } |
553 | 553 |
554 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 554 #if defined(FEAT_QUICKFIX) |
555 /* | 555 /* |
556 * Show extra info in the preview window if there is something and | 556 * Show extra info in the preview window if there is something and |
557 * 'completeopt' contains "preview". | 557 * 'completeopt' contains "preview". |
558 * Skip this when tried twice already. | 558 * Skip this when tried twice already. |
559 * Skip this also when there is not much room. | 559 * Skip this also when there is not much room. |
713 void | 713 void |
714 pum_undisplay(void) | 714 pum_undisplay(void) |
715 { | 715 { |
716 pum_array = NULL; | 716 pum_array = NULL; |
717 redraw_all_later(SOME_VALID); | 717 redraw_all_later(SOME_VALID); |
718 #ifdef FEAT_WINDOWS | |
719 redraw_tabline = TRUE; | 718 redraw_tabline = TRUE; |
720 #endif | |
721 status_redraw_all(); | 719 status_redraw_all(); |
722 } | 720 } |
723 | 721 |
724 /* | 722 /* |
725 * Clear the popup menu. Currently only resets the offset to the first | 723 * Clear the popup menu. Currently only resets the offset to the first |