aboutsummaryrefslogtreecommitdiff
path: root/test/functional
Commit message (Collapse)AuthorAge
* refactor: move some constants out of vim_defs.h (#26298)zeertzjq2023-11-29
|
* perf(column): only invalidate lines affected by added signLuuk van Baal2023-11-29
|
* Merge pull request #26292 from luukvbaal/decorbfredl2023-11-29
|\ | | | | fix(decorations): do not apply sign highlight id as range attr id
| * fix(decorations): do not apply sign highlight id as range attr idLuuk van Baal2023-11-29
| |
* | vim-patch:9.0.2134: ml_get error when scrolling (#26264)zeertzjq2023-11-29
|/ | | | | | | | | | | | | | | | | | | | | | | | Problem: ml_get error when scrolling after delete Solution: mark topline to be validated in main_loop if it is larger than current buffers line count reset_lnums() is called after e.g. TextChanged autocommands and it may accidentally cause curwin->w_topline to become invalid, e.g. if the autocommand has deleted some lines. So verify that curwin->w_topline points to a valid line and if not, mark the window to have w_topline recalculated in main_loop() in update_topline() after reset_lnums() returns. fixes: vim/vim#13568 fixes: vim/vim#13578 https://github.com/vim/vim/commit/c4ffeddfe5bd1824650e9b911ed9245bf56c69e3 The error doesn't happen in Nvim because Nvim triggers TextChanged after calling update_topline(). Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(column): redraw and update signcols for paired extmarkLuuk van Baal2023-11-28
| | | | | | Problem: Signcolumn width does not increase when ranged sign does not start at sentinel line. Solution: Handle paired range of added sign when checking signcols.
* Merge pull request #26249 from bfredl/concealcharbfredl2023-11-28
|\ | | | | feat(decoration): allow conceal_char to be a composing char
| * feat(decoration): allow conceal_char to be a composing charbfredl2023-11-28
| | | | | | | | | | | | | | | | decor->text.str pointer must go. This removes it for conceal char, in preparation for a larger PR which will also handle the sign case. By actually allowing composing chars for a conceal chars, this becomes a feature and not just a refactor, as a bonus.
* | vim-patch:9.0.2133: Cannot detect overstrike mode in Cmdline mode (#26263)zeertzjq2023-11-28
|/ | | | | | | | Problem: Cannot detect overstrike mode in Cmdline mode Solution: Make mode() return "cr" for overstrike closes: vim/vim#13569 https://github.com/vim/vim/commit/d1c3ef1f47c87d1da056c56564e1985fe6f2931d
* fix(treesitter): don't invalidate parser when discovering injectionsDmytro Soltys2023-11-27
| | | | | | | | | When parsing with a range, languagetree looks up injections and adds them if needed. This explicitly invalidates parser, making `is_valid` report `false` both when including and excluding children. This is an attempt to describe desired behaviour of `is_valid` in tests, with what ended up being a single line change to satisfy them.
* test: check vim.wait() error message in fast context (#26242)zeertzjq2023-11-27
|
* fix(lua): disallow vim.wait() in fast contextsLewis Russell2023-11-27
| | | | | | | `vim.wait()` cannot be called in a fast callback since the main loop cannot be run in that context as it is not reentrant Fixes #26122
* fix(mouse): avoid dragging when clicking next to popupmenu (#26201)luukvbaal2023-11-25
|
* fix(messages): validate msg_grid before using msg_grid_pos (#26189)zeertzjq2023-11-24
|
* fix(mouse): avoid dragging after click label popupmenu callback (#26187)luukvbaal2023-11-24
|
* vim-patch:9.0.2125: File info disappears when 'cmdheight' has decreased (#26180)zeertzjq2023-11-24
| | | | | | | | | | | Problem: File info disappears immediately when 'cmdheight' has just decreased due to switching tabpage and 'shortmess' doesn't contain 'o' or 'O'. Solution: Make sure msg_row isn't smaller than cmdline_row. fixes: vim/vim#13560 closes: vim/vim#13561 https://github.com/vim/vim/commit/40ed6711bd385051021691980e8ce16375b4b510
* fix(column): reset decor state before starting from topLuuk van Baal2023-11-23
|
* test: remove the pipe created by new_pipename() (#26173)zeertzjq2023-11-23
|
* fix(column): apply numhl signs when 'signcolumn' is "no" (#26167)luukvbaal2023-11-23
|
* feat(extmarks): add sign name to extmark "details" arrayLuuk van Baal2023-11-22
| | | | | | | | Problem: Unable to identify legacy signs when fetching extmarks with `nvim_buf_get_extmarks()`. Solution: Add "sign_name" to the extmark detail array. Add some misc. changes as follow-up to #25724
* fix(decorations): fix imbalanced sign countbfredl2023-11-22
|
* refactor(decorations): break up Decoration struct into smaller piecesbfredl2023-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the monolithic Decoration struct. Before this change, each extmark could either represent just a hl_id + priority value as a inline decoration, or it would take a pointer to this monolitic 112 byte struct which has to be allocated. This change separates the decorations into two pieces: DecorSignHighlight for signs, highlights and simple set-flag decorations (like spell, ui-watched), and DecorVirtText for virtual text and lines. The main separation here is whether they are expected to allocate more memory. Currently this is not really true as sign text has to be an allocated string, but the plan is to get rid of this eventually (it can just be an array of two schar_T:s). Further refactors are expected to improve the representation of each decoration kind individually. The goal of this particular PR is to get things started by cutting the Gordian knot which was the monolithic struct Decoration. Now, each extmark can either contain chained indicies/pointers to these kinds of objects, or it can fit a subset of DecorSignHighlight inline. The point of this change is not only to make decorations smaller in memory. In fact, the main motivation is to later allow them to grow _larger_, but on a dynamic, on demand fashion. As a simple example, it would be possible to augment highlights to take a list of multiple `hl_group`:s, which then would trivially map to a chain of multiple DecorSignHighlight entries. One small feature improvement included with this refactor itself, is that the restriction that extmarks cannot be removed inside a decoration provider has been lifted. These are instead safely lifetime extended on a "to free" list until the current iteration of screen drawing is done. NB: flags is a mess. but DecorLevel is useless, this slightly less so
* fix(messages): :map output with ext_messages (#26126)Bara C. Tudor2023-11-22
|
* fix(vim.region): handle multibyte inclusive selection properly (#26129)zeertzjq2023-11-21
|
* test: skip failing watch file tests on freebsd (#26110)Mathias Fußenegger2023-11-19
| | | | | | | | | Quick fix as follow up to https://github.com/neovim/neovim/pull/26108 kqueue only reports events on a watched folder itself, not for files created or deleted within. So the approach the PR took doesn't work on FreeBSD. We'll either need to bring back polling for it, combine watching with manual file tracking, or disable LSP file watching on FreeBSD
* perf(lsp): replace file polling on linux with per dir watcher (#26108)Mathias Fußenegger2023-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should help with https://github.com/neovim/neovim/issues/23291 On linux `new_fs_event` doesn't support recursive watching, but we can still use it to watch folders. The downside of this approach is that we may end up sending some false `Deleted` events. For example, if you save a file named `foo` there will be a intermediate `foo~` due to the save mechanism of neovim. The events we get from vim.uv in that case are: - rename: foo~ - rename: foo~ - rename: foo - rename: foo - change: foo - change: foo The mechanism in this PR uses a debounce to reduce this to: - deleted: foo~ - changed: foo `foo~` will be the false positive. I suspect that for the LSP case this is good enough. If not, we may need to follow up on this and keep a table in memory that tracks available files.
* Merge pull request #25724 from luukvbaal/signmergebfredl2023-11-18
|\ | | | | refactor(sign): move legacy signs to extmarks
| * refactor(sign): move legacy signs to extmarksLuuk van Baal2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
* | fix(completion): filter results with complete+=f (#26029)Raphael2023-11-18
| |
* | refactor(snippet): rename test utilitiesMaria José Solano2023-11-17
| |
* | feat(lsp): support for choice snippet nodesMaria José Solano2023-11-17
| |
* | fix(tui): handle cursor visibility properly (#26091)zeertzjq2023-11-17
| | | | | | | | The test is for the case without 'termsync' because libvterm doesn't support synchronized output, and it passes without this PR.
* | refactor(grid): make screen rendering more multibyte than ever beforebfredl2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: buffer text with composing chars are converted from UTF-8 to an array of up to seven UTF-32 values and then converted back to UTF-8 strings. Solution: Convert buffer text directly to UTF-8 based schar_T values. The limit of the text size is now in schar_T bytes, which is currently 31+1 but easily could be raised as it no longer multiplies the size of the entire screen grid when not used, the full size is only required for temporary scratch buffers. Also does some general cleanup to win_line text handling, which was unnecessarily complicated due to multibyte rendering being an "opt-in" feature long ago. Nowadays, a char is just a char, regardless if it consists of one ASCII byte or multiple bytes.
* | vim-patch:9.0.1969: [security] buffer-overflow in trunc_string()zeertzjq2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: buffer-overflow in trunc_string() Solution: Add NULL at end of buffer Currently trunc_string() assumes that when the string is too long, buf[e-1] will always be writeable. But that assumption may not always be true. The condition currently looks like this else if (e + 3 < buflen) [...] else { // can't fit in the "...", just truncate it buf[e - 1] = NUL; } but this means, we may run into the last else clause with e still being larger than buflen. So a buffer overflow occurs. So instead of using `buf[e - 1]`, let's just always truncate at `buf[buflen - 1]` which should always be writable. https://github.com/vim/vim/commit/3bd7fa12e146c6051490d048a4acbfba974eeb04 vim-patch:9.0.2004: Missing test file Problem: Missing test file Solution: git-add the file to the repo closes: vim/vim#13305 https://github.com/vim/vim/commit/d4afbdd0715c722cfc73d3a8ab9e578667615faa Co-authored-by: Christian Brabandt <cb@256bit.org>
* | vim-patch:9.0.2107: [security]: FPE in adjust_plines_for_skipcol (#26082)zeertzjq2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security]: FPE in adjust_plines_for_skipcol Solution: don't divide by zero, return zero Prevent a floating point exception when calculating w_skipcol (which can happen with a small window when the number option is set and cpo+=n). Add a test to verify https://github.com/vim/vim/commit/cb0b99f0672d8446585d26e998343dceca17d1ce Co-authored-by: Christian Brabandt <cb@256bit.org>
* | feat: add vim.text module (#26069)Gregory Anders2023-11-16
|/
* vim-patch:9.0.2105: skipcol not reset when topline changed (#26042)luukvbaal2023-11-15
| | | | | | | | Problem: Skipcol is not reset when topline changed scrolling cursor to top Solution: reset skipcol closes: vim/vim#13528 https://github.com/vim/vim/commit/bb800a7907209f7d349f87b76b3b9ca30b416298
* feat(tui): add 'termsync' option (#25871)Gregory Anders2023-11-14
| | | | | | | The 'termsync' option enables a mode (provided the underlying terminal supports it) where all screen updates during a redraw cycle are buffered and drawn together when the redraw is complete. This eliminates tearing or flickering in cases where Nvim redraws slower than the terminal redraws the screen.
* fix(defaults): set 'fsync' #26034Ploum2023-11-14
| | | | | | | | Problem: 'nofsync' may lose data if the system has a hard shutdown. #9888 Solution: Change default to 'fsync'. This may be revisited in the future when 'nofsync' can be made safer.
* test: use ST terminator instead of BEL in OSC sequencesGregory Anders2023-11-13
| | | | | | | libtermkey does not interpret OSC sequences that end with a BEL (0x07) instead of an ST (0x1b 0x5c) terminator. This causes these tests to fail since the OSC response is now parsed via libtermkey. Change the tests to use the ST terminator to appease libtermkey.
* docs: deprecate the "term_background" UI fieldGregory Anders2023-11-13
|
* feat(statuscolumn): re-evaluate for every screen line (#25885)luukvbaal2023-11-13
| | | | | Problem: v:virtnum is less useful than it could be. Solution: Always re-evaluate 'statuscolumn', and update v:virtnum accordingly.
* vim-patch:9.0.2102: matchparen highlight not cleared in completion mode (#26019)zeertzjq2023-11-13
| | | | | | | | | | | | | | | | | Problem: matchparen highlight not cleared in completion mode Solution: Clear matchparen highlighting in completion mode Remove hard-coded hack in insexpand.c to clear the :3match before displaying the completion menu. Add a test for matchparen highlighting. While at it, move all test tests related to the matchparen plugin into a separate test file. closes: vim/vim#13493 closes: vim/vim#13524 https://github.com/vim/vim/commit/9588666360e94de3ff58d4bc79aa9148fbf5fc44 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:8.2.4809: various things no6 properly tested (#26017)zeertzjq2023-11-13
| | | | | | | | Problem: Various things no6 properly tested. Solution: Add various test cases. (Yegappan Lakshmanan, closes vim/vim#10259) https://github.com/vim/vim/commit/885de449c0c0ef4a8541ed1f5377351844384516 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* 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.
* feat(lsp)!: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512LW2023-11-12
| | | | | | | | | | | | | | | | | | refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()` Problem: The LSP specification allows inlay hints to include tooltips, clickable label parts, and code actions; but Neovim provides no API to query for these. Solution: Add minimal viable extension point from which plugins can query for inlay hints in a range, in order to build functionality on top of. Possible Next Steps --- - Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
* fix(float): apply 'winblend' to title/footer highlight (#25999)zeertzjq2023-11-12
|
* fix(highlight): apply 'winblend' to float border (#25981)zeertzjq2023-11-11
|
* fix(context): don't leak memory on multiple invalid objects (#25979)zeertzjq2023-11-11
|
* fix(context): don't crash on invalid arg to nvim_get_context (#25977)zeertzjq2023-11-11
| | | | Note: The crash happens in the second test case when using uninitialized memory, and therefore doesn't happen with ASAN.