comparison src/popupmenu.c @ 772:aaaca5077255

updated for version 7.0226
author vimboss
date Thu, 16 Mar 2006 21:41:35 +0000
parents f0d0d3d3a1e2
children
comparison
equal deleted inserted replaced
771:c0f1b710ce07 772:aaaca5077255
56 int i; 56 int i;
57 int top_clear; 57 int top_clear;
58 int row; 58 int row;
59 int height; 59 int height;
60 int col; 60 int col;
61 int above_row = cmdline_row;
61 62
62 redo: 63 redo:
63 def_width = PUM_DEF_WIDTH; 64 def_width = PUM_DEF_WIDTH;
64 max_width = 0; 65 max_width = 0;
65 kind_width = 0; 66 kind_width = 0;
77 78
78 if (firstwin->w_p_pvw) 79 if (firstwin->w_p_pvw)
79 top_clear = firstwin->w_height; 80 top_clear = firstwin->w_height;
80 else 81 else
81 top_clear = 0; 82 top_clear = 0;
83
84 /* When the preview window is at the bottom stop just above it. Also
85 * avoid drawing over the status line so that it's clear there is a window
86 * boundary. */
87 if (lastwin->w_p_pvw)
88 above_row -= lastwin->w_height + lastwin->w_status_height + 1;
82 89
83 /* 90 /*
84 * Figure out the size and position of the pum. 91 * Figure out the size and position of the pum.
85 */ 92 */
86 if (size < PUM_DEF_HEIGHT) 93 if (size < PUM_DEF_HEIGHT)
90 if (p_ph > 0 && pum_height > p_ph) 97 if (p_ph > 0 && pum_height > p_ph)
91 pum_height = p_ph; 98 pum_height = p_ph;
92 99
93 /* Put the pum below "row" if possible. If there are few lines decide on 100 /* Put the pum below "row" if possible. If there are few lines decide on
94 * where there is more room. */ 101 * where there is more room. */
95 if (row >= cmdline_row - pum_height 102 if (row >= above_row - pum_height
96 && row > (cmdline_row - top_clear - height) / 2) 103 && row > (above_row - top_clear - height) / 2)
97 { 104 {
98 /* pum above "row" */ 105 /* pum above "row" */
99 if (row >= size) 106 if (row >= size)
100 { 107 {
101 pum_row = row - size; 108 pum_row = row - size;
114 } 121 }
115 else 122 else
116 { 123 {
117 /* pum below "row" */ 124 /* pum below "row" */
118 pum_row = row + height; 125 pum_row = row + height;
119 if (size > cmdline_row - pum_row) 126 if (size > above_row - pum_row)
120 pum_height = cmdline_row - pum_row; 127 pum_height = above_row - pum_row;
121 else 128 else
122 pum_height = size; 129 pum_height = size;
123 if (p_ph > 0 && pum_height > p_ph) 130 if (p_ph > 0 && pum_height > p_ph)
124 pum_height = p_ph; 131 pum_height = p_ph;
125 } 132 }