aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/popupmenu.c
Commit message (Collapse)AuthorAge
...
* refactor(IWYU): move decor provider types to decoration_defs.h (#26692)zeertzjq2023-12-21
|
* refactor: eliminate cyclic includesdundargoc2023-12-20
|
* refactor: use `bool` to represent boolean valuesdundargoc2023-12-19
|
* feat(ui): completeopt support popup like vimmathew2023-12-16
|
* refactor(options): reduce `findoption()` usageFamiu Haque2023-12-09
| | | | | | Problem: Many places in the code use `findoption()` to access an option using its name, even if the option index is available. This is very slow because it requires looping through the options array over and over. Solution: Use option index instead of name wherever possible. Also introduce an `OptIndex` enum which contains the index for every option as enum constants, this eliminates the need to pass static option names as strings.
* refactor: move some constants out of vim_defs.h (#26298)zeertzjq2023-11-29
|
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
|
* fix(mouse): avoid dragging when clicking next to popupmenu (#26201)luukvbaal2023-11-25
|
* fix(mouse): avoid dragging after click label popupmenu callback (#26187)luukvbaal2023-11-24
|
* refactor: follow style guidedundargoc2023-11-19
| | | | | - reduce variable scope - prefer initialization over declaration and assignment
* refactor: follow style guidedundargoc2023-11-13
| | | | | | - reduce variable scope - prefer initialization over declaration and assignment - use bool to represent boolean values
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* refactor: remove redundant castsdundargoc2023-11-11
|
* refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
* build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
|
* refactor(grid): unify the two put-text-on-the-screen code pathsbfredl2023-09-29
| | | | | | | | | | | | | | | | | | | | | | | The screen grid refactors will continue until morale improves. Jokes aside, this is quite a central installment in the series. Before this refactor, there were two fundamentally distinct codepaths for getting some text on the screen: - the win_line() -> grid_put_linebuf() -> ui_line() call chain used for buffer text, with linebuf_char as a temporary scratch buffer - the grid_line_start/grid_line_puts/grid_line_flush() -> ui_line() path used for every thing else: statuslines, messages and the command line. Here the grid->chars[] array itself doubles as a scratch buffer. With this refactor, the later family of functions still exist, however they now as well render to linebuf_char just like win_line() did, and grid_put_linebuf() is called in the end to calculate delta changes. This means we don't need any duplicate logic for delta calculations anymore. Later down the line, it will be possible to share more logic operating on this scratch buffer, like doing 'rightleft' reversal and arabic shaping as a post-processing step.
* refactor(grid): properly namespace and separate stateful grid functionsbfredl2023-09-22
| | | | | | | | | | | | | | | | | | | | | | | This is a step in an ongoing refactor where the "grid_puts" and "grid_put_linebuf" code paths will share more of the implementation (in particular for delta calculation, doublewidth and 'arabicshape' handling). But it also makes sense by its own as a cleanup, and is thus committed separately. Before this change many of the low level grid functions grid_puts, grid_fill etc could both be used in a standalone fashion but also as part of a batched line update which would be finally transmitted as a single grid_line call (via ui_line() ). This was initially useful to quickly refactor pre-existing vim code to use batched logic safely. However, this pattern is not really helpful for maintainable and newly written code, where the "grid" and "row" arguments are just needlessly repeated. This simplifies these calls to just use grid and row as specified in the initial grid_line_start(grid, row) call. This also makes the intent clear whether any grid_puts() call is actually part of a batch or not, which is better in the long run when more things get refactored to use effective (properly batched) updates.
* refactor(options): remove `getoption_T` and introduce `OptVal` (#23850)Famiu Haque2023-06-07
| | | | | | | | Removes the `getoption_T` struct and also introduces the `OptVal` struct to unify the methods of getting/setting different option value types. This is the first of many PRs to reduce code duplication in the Vim option code as well as to make options easier to maintain. It also increases the flexibility and extensibility of options. Which opens the door for things like Array and Dictionary options.
* refactor(api): new helper macrosFamiu Haque2023-05-23
| | | | Adds new API helper macros `CSTR_AS_OBJ()`, `STATIC_CSTR_AS_OBJ()`, and `STATIC_CSTR_TO_OBJ()`, which cleans up a lot of the current code. These macros will also be used extensively in the upcoming option refactor PRs because then API Objects will be used to get/set options. This PR also modifies pre-existing code to use old API helper macros like `CSTR_TO_OBJ()` to make them cleaner.
* vim-patch:9.0.1523: some error messages are not marked for translation (#23529)zeertzjq2023-05-08
| | | | | | Problem: Some error messages are not marked for translation. Solution: Surround the messages in _(). (closes vim/vim#12356) https://github.com/vim/vim/commit/276410e78f0b82e3123059383994d2f4c578dfbd
* fix(pum): don't position too far with resized parent grid (#23442)zeertzjq2023-05-03
|
* fix(pum): fix missing scrollbar with 'rightleft' (#23448)zeertzjq2023-05-03
|
* fix(pum): fix missing rightmost column with 'rightleft' (#23445)zeertzjq2023-05-02
|
* fix(pum): make :popup position correctly with float borderzeertzjq2023-04-28
|
* fix(pum): position properly with ext_multigrid (#23336)zeertzjq2023-04-27
|
* refactor: uncrustifydundargoc2023-04-26
| | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
* fix(pum): show right-click menu above cmdline area (#23298)zeertzjq2023-04-24
|
* refactor(screen): screen.c delenda estbfredl2023-03-14
| | | | | | | | | | | | | drawscreen.c vs screen.c makes absolutely no sense. The screen exists only to draw upon it, therefore helper functions are distributed randomly between screen.c and the file that does the redrawing. In addition screen.c does a lot of drawing on the screen. It made more sense for vim/vim as our grid.c is their screen.c Not sure if we want to dump all the code for option chars into optionstr.c, so keep these in a optionchar.c for now.
* vim-patch:9.0.1397: highlight for popupmenu kind and extra cannot be set ↵zeertzjq2023-03-11
| | | | | | | | | | | (#22619) Problem: Highlight for popupmenu kind and extra cannot be set. Solution: Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel highlight groups and use them. (Gianmaria Bajo, closes vim/vim#12114) https://github.com/vim/vim/commit/6a7c7749204b256e779c245b1e999bf852ad7b64 Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
* refactor: reduce scope of locals as per the style guide (#22206)dundargoc2023-02-11
|
* refactor(ui): remove some superfluous ui_flush() callsbfredl2023-02-09
| | | | | | | | - <expr> mapping has no business saving and restoring the low-level UI cursor. The cursor will be put in a reasonable position after input is processed, chill out. - TUI handles output needed for suspend - vgetc() family of function does flushing
* vim-patch:8.2.0382: some tests fail when run under valgrind (#21936)zeertzjq2023-01-21
| | | | | | | | | | Problem: Some tests fail when run under valgrind. Solution: Increase timeouts. https://github.com/vim/vim/commit/353c351bd22e4dac4c3ae9cd7731032348f248c4 Cherry-pick Test_pum_with_preview_win() from patch 8.2.0011. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4655: cmdline completion popup menu positioned wrong (#21894)zeertzjq2023-01-19
| | | | | | | | | | | | | Problem: Command line completion popup menu positioned wrong when using a terminal window. Solution: Position the popup menu differently when editing the command line. (Yegappan Lakshmanan, closes vim/vim#10050, closes vim/vim#10035) https://github.com/vim/vim/commit/1104a6d0c2004d39e9b6cb8f804d12b628a69869 The test in the patch looks a bit hard to understand. Add a Lua test that is more straightforward. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* Merge pull request #21731 from tk-shirasaka/fix/builtin_popup_on_ext_popupmenubfredl2023-01-15
|\ | | | | fix: properly close builtin popup in ext_popupmenu
| * fix: properly close builtin popup in ext_popupmenushirasaka2023-01-11
| |
* | refactor: replace char_u with char 21 (#21779)dundargoc2023-01-14
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* | refactor: replace char_u with char 20 (#21714)dundargoc2023-01-13
|/ | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* vim-patch:8.2.2207: illegal memory access if popup menu items are changed ↵zeertzjq2022-11-12
| | | | | | | | | | | (#21028) Problem: Illegal memory access if popup menu items are changed while the menu is visible. (Tomáš Janoušek) Solution: Make a copy of the text. (closes vim/vim#7537) https://github.com/vim/vim/commit/38455a921395a56690790c8c1d28c1c43ca04c8a Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: fix clang-tidy warningsdundargoc2022-11-06
| | | | | | | | Enable and fix bugprone-misplaced-widening-cast warning. Fix some modernize-macro-to-enum and readability-else-after-return warnings, but don't enable them. While the warnings can be useful, they are in general too noisy to enable.
* feat(api): nvim_select_popupmenu_item support cmdline pum (#20652)zeertzjq2022-10-17
|
* fix(completion): set pum_size even if ext_popupmenu is used (#20648)zeertzjq2022-10-14
| | | | This allows CompleteChanged event to get the correct `v:event.size`. It should be harmless and more consistent to also set `pum_array`.
* refactor(redraw): no type argument in update_screen()bfredl2022-10-05
| | | | | | | | | | This was used in the past with assumption that curwin/curbuf is "special" but this has not been true since basically forever at this point. Reduce NOT_VALID/CLEAR panic in options.lua . These should not be set if an effect of the option is causing something which by itself invokes redraw_later().
* refactor: replace char_u with charDundar Göc2022-09-11
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor(ex_cd): add an early return to fix clint warningzeertzjq2022-09-05
| | | | The popupmenu.c change is unrelated.
* feat(pum): pretend 'mousemoveevent' is set when showing right-click menuzeertzjq2022-09-04
|
* refactor: replace char_u with char 4 (#19987)dundargoc2022-08-30
| | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-08-29
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-08-26
| | | | Work on https://github.com/neovim/neovim/issues/459