aboutsummaryrefslogtreecommitdiff
path: root/test/functional
Commit message (Collapse)AuthorAge
...
| * | | fix(treesitter): don't trample parsers when filetype!=langLewis Russell2023-02-10
| | | | | | | | | | | | | | | | | | | | This allows vim.treesitter.show_tree() to work on buffers where the filetype does not match the parser language name e.g, bash/sh.
* | | | fix(ui): make sure screen is valid after resizingzeertzjq2023-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When not inside an Ex command, screen_resize() calls update_screen(), which calls screenclear() and set the screen as valid. However, when inside an Ex command, redrawing is postponed so update_screen() screen doesn't do anything, and the screen is still invalid after the resize, causing ui_comp_raw_line() to be no-op until update_screen() is called on the main loop. Solution: Restore the call to screenclear() inside screen_resize() so that the screen is invalid after screen_resize(). Since screenclear() changes redraw type from UPD_CLEAR to UPD_NOT_VALID, it is called at most once for each resize, so this shouldn't change how much code is run in the common (not inside an Ex command) case.
* | | | fix(filetype): make vim.filetype.match() work with contents only (#22181)Jonas Strittmatter2023-02-11
| | | | | | | | | | | | Co-authored-by: Gregory Anders <greg@gpanders.com>
* | | | vim-patch:9.0.1298: inserting register on the cmdline does not trigger incsearchzeertzjq2023-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Inserting a register on the command line does not trigger incsearch or update hlsearch. Solution: Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate and handle it correctly. (Ken Takata, closes vim/vim#11960) https://github.com/vim/vim/commit/c4b7dec38292fe1cfad7aa5f244031fc6f7c7a09 Co-authored-by: K.Takata <kentkt@csc.jp>
* | | | fix(rpc)!: preseve files when stdio channel is closed (#22137)zeertzjq2023-02-11
| |_|/ |/| | | | | | | | BREAKING CHANGE: Unsaved changes are now preserved rather than discarded when stdio channel is closed.
* | | fix(tests): fixes for using vim.mpack and more ASANbfredl2023-02-10
| | |
* | | refactor(tests): move lua-client into core and use it for functionaltestsbfredl2023-02-10
|/ / | | | | | | | | | | | | | | Eliminates lua-client and non-static libluv as test time dependencies Note: the API for a public lua-client is not yet finished. The interface needs to be adjusted to work in the embedded loop of a nvim instance (to use it to talk between instances)
* | test(exit_spec): make sure that autocommands are triggered (#22188)zeertzjq2023-02-09
| | | | | | | | | | Previously, if the autocommands are not triggered, the tests may still pass because no assertion is done. Add an assertion so that the tests will fail if the autocommands aren't triggered.
* | fix(rpc): ignore redraw events when exiting (#22184)zeertzjq2023-02-09
| | | | | | | | When a TUI client has already stopped, handling UI events will cause a heap-use-after-free, so ignore them.
* | fix(rpc): ignore redraw events when not in UI client (#21892)zeertzjq2023-02-09
| | | | | | Otherwise it will crash.
* | fix(decoration): don't show signcolumn for non-sign_text extmark (#22135)Lewis Russell2023-02-05
| | | | | | Fixes: #22127
* | feat(treesitter): add metadata option for get_node_textfigsoda2023-02-04
| |
* | feat(treesitter): allow capture text to be transformedfigsoda2023-02-04
| | | | | | | | Co-authored-by: Lewis Russell <lewis6991@gmail.com>
* | vim-patch:9.0.1279: display shows lines scrolled down erroneously (#22126)zeertzjq2023-02-05
|/ | | | | | | | Problem: Display shows lines scrolled down erroneously. (Yishai Lerner) Solution: Do not change "wl_lnum" at index zero. (closes vim/vim#11938) https://github.com/vim/vim/commit/61fdbfa1e3c842252b701aec12f45839ca41ece5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* Merge pull request #21331 from LiadOz/LiadOz/prompt-insert-extmarkbfredl2023-02-02
|\ | | | | fix(extmarks): adjust extmarks when inserting prompt prefix
| * fix(extmarks): adjust extmarks when inserting prompt prefixLiad Oz2023-01-14
| |
* | fix(column): estimate 'statuscolumn' width appropriatelyluukvbaal2023-02-02
| | | | | | | | | | | | | | | | | | | | | | Problem: The 'statuscolumn' width is being estimated without the proper context. In particular, this resulted in the fact that a custom fold column could be included in the estimated `number_width()`, and doubly added when actually drawing the statuscolumn due to `win_col_off()` also adding the `'foldcolumn'` width. Resulting in a status column that is `'foldcolumn'` cells wider than necessary. Solution: Estimate 'statuscolumn' width in `get_statuscol_str()` when a buffer's line count has changed.
* | fix(exit): skip unnecessary steps in TUI preserve_exit() (#21897)zeertzjq2023-02-02
| | | | | | | | This prevents the TUI from doing unexpected things when receiving a deadly signal or running out of memory.
* | fix(man): use italics for `<bs>_` (#22086)Lewis Russell2023-02-01
| | | | | | | | | | | | | | | | | | | | | | | | fix(man): use italics for <bs>_ Even though underline is strictly what this should be. <bs>_ was used by nroff to indicate italics which wasn't possible on old typewriters so underline was used. Modern terminals now support italics so lets use that now. See: - https://unix.stackexchange.com/questions/274658/purpose-of-ascii-text-with-overstriking-file-format/274795#274795 - https://cmd.inp.nsk.su/old/cmd2/manuals/unix/UNIX_Unleashed/ch08.htm
* | Merge pull request #17537 from bfredl/neoluabfredl2023-01-31
|\ \ | | | | | | refactor(tests): run unittests using main nvim binary - delete separate nvim-test build
| * | refactor(tests): run unittests using main nvim binary in interpreter modebfredl2023-01-31
| | | | | | | | | | | | This allows us to get rid of the separate "nvim-test" target
* | | Merge pull request #22005 from clason/sanitize-langChristian Clason2023-01-31
|\ \ \ | |/ / |/| | fix(treesitter): validate language name
| * | fix(treesitter): validate language nameChristian Clason2023-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Some injections (like markdown) allow specifying arbitrary language names for code blocks, which may be lead to errors when looking for a corresponding parser in runtime path. Solution: Validate that the language name only contains alphanumeric characters and `_` (e.g., for `c_sharp`) and error otherwise.
* | | fix(tests): use -l mode for lsp testsbfredl2023-01-31
| | | | | | | | | | | | | | | This fixes "fake server" from leaking memory, which makes ASAN very upset, except on current ASAN CI for some reason.
* | | fix(highlight): properly deal with underline mask when listing (#22057)zeertzjq2023-01-31
|/ /
* | test: exepath() returns correct path with cmd.exe, powershell #21928Anton Kriese2023-01-26
| | | | | | | | | | | | | | | | | | | | test(exepath): test if exepath returns correct path with multiple Windows shells This test covers the changes from #21175 where exepath() is set to prefer file extensions in powershell.exe aswell as in cmd.exe. In both shells, the file with a valid extension should be returned instead of the extensionless file.
* | test: add test for :runtime completion for .luazeertzjq2023-01-26
| |
* | feat(highlight): define the concept of altfont as a (c)term rendering attributePaul "LeoNerd" Evans2023-01-24
| |
* | refactor(highlight): reshape the HL_UNDER* bits into a 3-bit integer maskPaul "LeoNerd" Evans2023-01-24
| | | | | | | | Saves two bits for reuse for new features
* | revert: "refactor(win_close): remove "force", don't pass on "free_buf" ↵zeertzjq2023-01-24
| | | | | | | | | | | | | | | | (#21921)" (#21979) This reverts commit 0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3. > 'bufhidden' option exists. I don't think we should assume autoclosing windows are fine just because 'hidden' is set.
* | fix(api): don't allow hiding aucmd_win from another tabpage (#21975)zeertzjq2023-01-24
| |
* | fix(lsp): check method is supported when range formatting (#21970)Sean Dewar2023-01-24
| | | | | | | | | | | | `vim.lsp.buf.format()` silently did nothing if no servers supported `textDocument/rangeFormatting` when formatting with a range. Issue found by `@hwrd:matrix.org` in the Matrix chat.
* | revert: "shada/context: fully remove jumplist duplicates #10898" (#21874)zeertzjq2023-01-23
| | | | | | | | | | This reverts commit 8b8ecf44f2cda43bbd710ec22ef99439b71888cd. It is causing performance problems on exit. Fix #21082.
* | refactor(win_close): remove "force", don't pass on "free_buf" (#21921)zeertzjq2023-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The "force" flag of win_close() complicates the code and adds edge cases where it is not clear what the correct behavior should be. The "free_buf" flag of win_close() is passed on to float windows when closing the last window of a tabpage, which doesn't make much sense. Solution: Remove the "force" flag and always close float windows as if :close! is used when closing the last window of a tabpage, and set the "free_buf" flag for a float window based on whether its buffer can be freed. As 'hidden' is on by default, this change shouldn't affect many people.
* | build: make generated source files reproducible #21586Arnout Engelen2023-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Build is not reproducible, because generated source files (.c/.h/) are not deterministic, mostly because Lua pairs() is unordered by design (for security). https://github.com/LuaJIT/LuaJIT/issues/626#issuecomment-707005671 https://www.lua.org/manual/5.1/manual.html#pdf-next > The order in which the indices are enumerated is not specified [...] > >> The hardening of the VM deliberately randomizes string hashes. This in >> turn randomizes the iteration order of tables with string keys. Solution: - Update the code generation scripts to be deterministic. - That is only a partial solution: the exported function (funcs_metadata.generated.h) and ui event (ui_events_metadata.generated.h) metadata have some mpack'ed tables, which are not serialized deterministically. - As a workaround, introduce `PRG_GEN_LUA` cmake setting, so you can inject a modified build of luajit (with LUAJIT_SECURITY_PRN=0) that preserves table order. - Longer-term we should change the mpack'ed data structure so it no longer uses tables keyed by strings. Closes #20124 Co-Authored-By: dundargoc <gocdundar@gmail.com> Co-Authored-By: Arnout Engelen <arnout@bzzt.net>
* | fix(extmarks): problems with folded virtual lines (#21930)luukvbaal2023-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When a folded line has virtual lines attached, the following problems occur: - The virtual lines are drawn empty. - The 'foldtext' line is drawn empty. - The cursor is drawn incorrectly. Solution: Check whether virtual lines belong to a folded line. Fix #17027 Fix #19557 Fix #21837 Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* | feat(treesitter): show filetype associated with parser (#17633)Matthieu Coudron2023-01-22
| | | | | | to ease debug. At one point I had an empty filetype and the current message was not helpful enough
* | fix(completion): include lua syntaxes in :ownsyntax completion (#21941)zeertzjq2023-01-22
| | | | | | | | This just removes DIP_LUA and always executes its branches. Also add tests for cmdline completion for other lua runtime files.
* | 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>
* | fix(remote): don't leak memory on failure to connect to server (#21931)zeertzjq2023-01-21
| | | | | | Also fix the race between output and resize in the test for this.
* | test(tui_spec): don't expect exact screen in rapid resize test (#21935)zeertzjq2023-01-21
| | | | | | | | There may be a race between resizes, so don't expect exact screen. Expect window width instead.
* | test(tui_spec): make rapid resize test test what it wants to test (#21933)zeertzjq2023-01-21
| | | | | | | | | | Actually execute the command. Don't use assert_alive() as it checks the host session instead of the child session. Use screen:expect() instead.
* | test(syn_attr_spec): add more information (#21912)zeertzjq2023-01-20
| | | | | | This makes it clear on test failure what the attributes are.
* | perf(statuscolumn): only fill click defs array once per redraw (#21884)luukvbaal2023-01-20
| | | | | | | | | | | | | | | | | | | | | | Problem: 'statuscolumn' click definitions are cleared, evaluated, allocated and filled each redraw for every row in a window. This despite the fact that we only store a single click definition array for the entire column as opposed to one for each row. Solution: Only fill the 'statuscolumn' click definition array once per window per redraw. Resolve https://github.com/neovim/neovim/issues/21767.
* | 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>
* | fix(statusline): don't leak memory with truncated click labelszeertzjq2023-01-19
| |
* | fix(statusline): don't leak memory with zero-width click labelszeertzjq2023-01-19
| | | | | | | | | | A zero-width click label isn't assigned to any click definition, so its function name should be freed when filling click definitions.
* | vim-patch:8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 ↵zeertzjq2023-01-19
| | | | | | | | | | | | | | | | | | | | (#21883) Problem: Cannot lock a variable in legacy Vim script like in Vim9. Solution: Make ":lockvar 0" work. https://github.com/vim/vim/commit/a187c43cfe8863d48b2159d695fedcb71f8525c1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | fix(statuscolumn): always fill click defs array (#21878)zeertzjq2023-01-18
| | | | | | | | | | | | | | | | Click definitions are always filled for tabline, statusline and winbar, so they should also be always filled for statuscolumn, otherwise it will leak memory. Note: this doesn't actually change the existing code much, because of a typo in the existing code.
* | fix(completion): correct what modes support fuzzy completionzeertzjq2023-01-17
| |