Mercurial > vim
comparison src/popupmenu.c @ 28773:d770568e6c98 v8.2.4911
patch 8.2.4911: the mode #defines are not clearly named
Commit: https://github.com/vim/vim/commit/249591057b4840785c50e41dd850efb8a8faf435
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 7 20:01:16 2022 +0100
patch 8.2.4911: the mode #defines are not clearly named
Problem: The mode #defines are not clearly named.
Solution: Prepend MODE_. Renumber them to put the mapped modes first.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 07 May 2022 21:15:06 +0200 |
parents | 4dcccb2673fe |
children | 86eac190ec42 |
comparison
equal
deleted
inserted
replaced
28772:7b07ca0bb292 | 28773:d770568e6c98 |
---|---|
99 int redo_count = 0; | 99 int redo_count = 0; |
100 #if defined(FEAT_QUICKFIX) | 100 #if defined(FEAT_QUICKFIX) |
101 win_T *pvwin; | 101 win_T *pvwin; |
102 #endif | 102 #endif |
103 #ifdef FEAT_RIGHTLEFT | 103 #ifdef FEAT_RIGHTLEFT |
104 int right_left = State == CMDLINE ? FALSE : curwin->w_p_rl; | 104 int right_left = State == MODE_CMDLINE ? FALSE : curwin->w_p_rl; |
105 #endif | 105 #endif |
106 | 106 |
107 do | 107 do |
108 { | 108 { |
109 def_width = p_pw; | 109 def_width = p_pw; |
117 pum_array = NULL; | 117 pum_array = NULL; |
118 | 118 |
119 // Remember the essential parts of the window position and size, so we | 119 // Remember the essential parts of the window position and size, so we |
120 // can decide when to reposition the popup menu. | 120 // can decide when to reposition the popup menu. |
121 pum_window = curwin; | 121 pum_window = curwin; |
122 if (State == CMDLINE) | 122 if (State == MODE_CMDLINE) |
123 // cmdline completion popup menu | 123 // cmdline completion popup menu |
124 pum_win_row = cmdline_row; | 124 pum_win_row = cmdline_row; |
125 else | 125 else |
126 pum_win_row = curwin->w_wrow + W_WINROW(curwin); | 126 pum_win_row = curwin->w_wrow + W_WINROW(curwin); |
127 pum_win_height = curwin->w_height; | 127 pum_win_height = curwin->w_height; |
157 if (pum_win_row + 2 >= below_row - pum_height | 157 if (pum_win_row + 2 >= below_row - pum_height |
158 && pum_win_row - above_row > (below_row - above_row) / 2) | 158 && pum_win_row - above_row > (below_row - above_row) / 2) |
159 { | 159 { |
160 // pum above "pum_win_row" | 160 // pum above "pum_win_row" |
161 | 161 |
162 if (State == CMDLINE) | 162 if (State == MODE_CMDLINE) |
163 // for cmdline pum, no need for context lines | 163 // for cmdline pum, no need for context lines |
164 context_lines = 0; | 164 context_lines = 0; |
165 else | 165 else |
166 { | 166 { |
167 // Leave two lines of context if possible | 167 // Leave two lines of context if possible |
189 } | 189 } |
190 else | 190 else |
191 { | 191 { |
192 // pum below "pum_win_row" | 192 // pum below "pum_win_row" |
193 | 193 |
194 if (State == CMDLINE) | 194 if (State == MODE_CMDLINE) |
195 // for cmdline pum, no need for context lines | 195 // for cmdline pum, no need for context lines |
196 context_lines = 0; | 196 context_lines = 0; |
197 else | 197 else |
198 { | 198 { |
199 // Leave two lines of context if possible | 199 // Leave two lines of context if possible |
233 pum_compute_size(); | 233 pum_compute_size(); |
234 max_width = pum_base_width; | 234 max_width = pum_base_width; |
235 | 235 |
236 // Calculate column | 236 // Calculate column |
237 #ifdef FEAT_WILDMENU | 237 #ifdef FEAT_WILDMENU |
238 if (State == CMDLINE) | 238 if (State == MODE_CMDLINE) |
239 // cmdline completion popup menu | 239 // cmdline completion popup menu |
240 cursor_col = cmdline_compl_startcol(); | 240 cursor_col = cmdline_compl_startcol(); |
241 else | 241 else |
242 #endif | 242 #endif |
243 #ifdef FEAT_RIGHTLEFT | 243 #ifdef FEAT_RIGHTLEFT |