Mercurial > vim
comparison runtime/doc/popup.txt @ 16853:e6bcccccbf7b v8.1.1428
patch 8.1.1428: popup_atcursor() not implemented yet
commit https://github.com/vim/vim/commit/cc31ad9f9b601d53926b96586bd6b40602d57951
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 30 19:25:06 2019 +0200
patch 8.1.1428: popup_atcursor() not implemented yet
Problem: Popup_atcursor() not implemented yet.
Solution: Implement it. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/4456)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 30 May 2019 19:30:03 +0200 |
parents | cf630fab9fb6 |
children | 19162ff4eacd |
comparison
equal
deleted
inserted
replaced
16852:014021a1f556 | 16853:e6bcccccbf7b |
---|---|
83 Probably 2. is the best choice. | 83 Probably 2. is the best choice. |
84 | 84 |
85 | 85 |
86 IMPLEMENTATION: | 86 IMPLEMENTATION: |
87 - Code is in popupwin.c | 87 - Code is in popupwin.c |
88 - when creating the window set options to Vim default? (verify with 'number') | 88 - Implement the "pos" option. |
89 - Implement filter. | 89 - Implement filter. |
90 Check that popup_close() works in the filter. | 90 Check that popup_close() works in the filter. |
91 - Implement the "pos" option. | |
92 - Handle screen resize in screenalloc(). | 91 - Handle screen resize in screenalloc(). |
92 - show [Popup] instead of [Scratch] in ":ls!" | |
93 - Make redrawing more efficient and avoid flicker. | 93 - Make redrawing more efficient and avoid flicker. |
94 Store popup info in a mask, use the mask in screen_line() | 94 Store popup info in a mask, use the mask in screen_line() |
95 Fix redrawing problem with completion. | 95 Fix redrawing problem with completion. |
96 Fix redrawing problem when scrolling non-current window | 96 Fix redrawing problem when scrolling non-current window |
97 Fix redrawing the statusline on top of a popup | 97 Fix redrawing the statusline on top of a popup |
98 - Figure out the size and position better. | 98 - Figure out the size and position better. |
99 if wrapping splits a double-wide character | 99 if wrapping splits a double-wide character |
100 if wrapping has an indent | 100 if wrapping inserts indent |
101 - Can the buffer be re-used, to avoid using up lots of buffer numbers? | 101 - Can the buffer be re-used, to avoid using up lots of buffer numbers? |
102 - Implement all the unimplemented options and features. | 102 - Implement all the unimplemented options and features. |
103 | 103 |
104 | 104 |
105 ============================================================================== | 105 ============================================================================== |
158 \ }) | 158 \ }) |
159 < Use {options} to change the properties. | 159 < Use {options} to change the properties. |
160 | 160 |
161 | 161 |
162 popup_atcursor({text}, {options}) *popup_atcursor()* | 162 popup_atcursor({text}, {options}) *popup_atcursor()* |
163 {not implemented yet} | |
164 Show the {text} above the cursor, and close it when the cursor | 163 Show the {text} above the cursor, and close it when the cursor |
165 moves. This works like: > | 164 moves. This works like: > |
166 call popup_create({text}, { | 165 call popup_create({text}, { |
166 \ 'pos': 'botleft', | |
167 \ 'line': 'cursor-1', | 167 \ 'line': 'cursor-1', |
168 \ 'col': 'cursor', | 168 \ 'col': 'cursor', |
169 \ 'moved': 'WORD', | 169 \ 'moved': 'WORD', |
170 \ }) | 170 \ }) |
171 < Use {options} to change the properties. | 171 < Use {options} to change the properties. |
268 - 'buftype' is "popup" | 268 - 'buftype' is "popup" |
269 - 'swapfile' is off | 269 - 'swapfile' is off |
270 - 'bufhidden' is "hide" | 270 - 'bufhidden' is "hide" |
271 - 'buflisted' is off | 271 - 'buflisted' is off |
272 - 'undolevels' is -1: no undo at all | 272 - 'undolevels' is -1: no undo at all |
273 TODO: more | 273 - all other buffer-local and window_local options are set to their Vim default |
274 | 274 value. |
275 It is possible to change these options, but anything might break then, so | 275 |
276 better leave them alone. | 276 It is possible to change the specifically mentioned options, but anything |
277 might break then, so better leave them alone. | |
277 | 278 |
278 The window does have a cursor position, but the cursor is not displayed. | 279 The window does have a cursor position, but the cursor is not displayed. |
279 | 280 |
280 To execute a command in the context of the popup window and buffer use | 281 To execute a command in the context of the popup window and buffer use |
281 `win_execute()`. Example: > | 282 `win_execute()`. Example: > |
304 The second argument of |popup_create()| is a dictionary with options: | 305 The second argument of |popup_create()| is a dictionary with options: |
305 line screen line where to position the popup; can use | 306 line screen line where to position the popup; can use |
306 "cursor", "cursor+1" or "cursor-1" to use the line of | 307 "cursor", "cursor+1" or "cursor-1" to use the line of |
307 the cursor and add or subtract a number of lines; | 308 the cursor and add or subtract a number of lines; |
308 default is "cursor-1". | 309 default is "cursor-1". |
309 {only number is implemented} | |
310 col screen column where to position the popup; can use | 310 col screen column where to position the popup; can use |
311 "cursor" to use the column of the cursor, "cursor+99" | 311 "cursor" to use the column of the cursor, "cursor+99" |
312 and "cursor-99" to add or subtract a number of | 312 and "cursor-99" to add or subtract a number of |
313 columns; default is "cursor" | 313 columns; default is "cursor" |
314 {only number is implemented} | |
315 pos "topleft", "topright", "botleft" or "botright": | 314 pos "topleft", "topright", "botleft" or "botright": |
316 defines what corner of the popup "line" and "col" are | 315 defines what corner of the popup "line" and "col" are |
317 used for. When not set "topleft" is used. | 316 used for. When not set "topleft" is used. |
318 Alternatively "center" can be used to position the | 317 Alternatively "center" can be used to position the |
319 popup in the center of the Vim window. | 318 popup in the center of the Vim window. |
340 {not implemented yet} | 339 {not implemented yet} |
341 wrap TRUE to make the lines wrap (default TRUE) | 340 wrap TRUE to make the lines wrap (default TRUE) |
342 {not implemented yet} | 341 {not implemented yet} |
343 highlight highlight group name to use for the text, stored in | 342 highlight highlight group name to use for the text, stored in |
344 the 'wincolor' option | 343 the 'wincolor' option |
344 padding list with numbers, defining the padding | |
345 above/right/below/left of the popup (similar to CSS); | |
346 an empty list uses a padding of 1 all around; the | |
347 padding goes around the text, inside any border; | |
348 padding uses the 'wincolor' highlight; Example: [1, 2, | |
349 1, 3] has 1 line of padding above, 2 columns on the | |
350 right, 1 line below and 3 columns on the left | |
351 {not implemented yet} | |
345 border list with numbers, defining the border thickness | 352 border list with numbers, defining the border thickness |
346 above/right/below/left of the popup; an empty list | 353 above/right/below/left of the popup (similar to CSS); |
347 uses a border of 1 all around | 354 an empty list uses a border of 1 all around |
348 {not implemented yet} | 355 {not implemented yet} |
349 borderhighlight highlight group name to use for the border | 356 borderhighlight highlight group name to use for the border |
350 {not implemented yet} | 357 {not implemented yet} |
351 borderchars list with characters, defining the character to use | 358 borderchars list with characters, defining the character to use |
352 for the top/right/bottom/left border; optionally | 359 for the top/right/bottom/left border; optionally |