aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* feat(treesitter): upstream foldexpr from nvim-treesitterLewis Russell2023-02-23
|
* perf(treesitter): smarter languagetree invalidationLewis Russell2023-02-23
| | | | | | | | | | | | | | Problem: Treesitter injections are slow because all injected trees are invalidated on every change. Solution: Implement smarter invalidation to avoid reparsing injected regions. - In on_bytes, try and update self._regions as best we can. This PR just offsets any regions after the change. - Add valid flags for each region in self._regions. - Call on_bytes recursively for all children. - We still need to run the query every time for the top level tree. I don't know how to avoid this. However, if the new injection ranges don't change, then we re-use the old trees and avoid reparsing children. This should result in roughly a 2-3x reduction in tree parsing when the comment injections are enabled.
* test(help): drop treesitter parse error to 0Christian Clason2023-02-23
| | | | | All parser errors have been fixed; make sure we don't introduce new ones.
* fix(highlight): avoid ORing underline flags (#22372)zeertzjq2023-02-23
| | | | | When combining attributes use the one that takes priority. For :highlight command use the last one specified. For API use a hard-coded order same as the order in docs.
* feat(lua): make sure require'bit' always works, even with PUC lua 5.1bfredl2023-02-22
|
* feat(treesitter): add filetype -> lang APILewis Russell2023-02-21
| | | | | | | | | | | | | | | | | | Problem: vim.treesitter does not know how to map a specific filetype to a parser. This creates problems since in a few places (including in vim.treesitter itself), the filetype is incorrectly used in place of lang. Solution: Add an API to enable this: - Add vim.treesitter.language.add() as a replacement for vim.treesitter.language.require_language(). - Optional arguments are now passed via an opts table. - Also takes a filetype (or list of filetypes) so we can keep track of what filetypes are associated with which langs. - Deprecated vim.treesitter.language.require_language(). - Add vim.treesitter.language.get_lang() which returns the associated lang for a given filetype. - Add vim.treesitter.language.register() to associate filetypes to a lang without loading the parser.
* test(legacy/prompt_buffer_spec): align script with oldtest more (#22354)zeertzjq2023-02-21
|
* fix(lsp): check if the buffer is a directory before w! it (#22289)Eduard Baturin2023-02-18
|
* test(tui_spec): use RPC request to setup autocommandszeertzjq2023-02-18
| | | | This avoids changing cmdline and fixes a warning.
* test: make {MATCH:} behave less unexpectedly in screen:expect()zeertzjq2023-02-18
| | | | Include the rest of the line and allow multiple {MATCH:} patterns.
* fix(api): allow empty Lua table for nested dicts #22268Justin M. Keyes2023-02-16
| | | | | | | | | | | | | | | Problem: The Lua-API bridge allows Dict params to be empty Lua (list) tables at the function-signature level. But not for _nested_ Dicts, because they are not modeled: https://github.com/neovim/neovim/blob/fae754073289566051433fae74ec65783f9e7a6a/src/nvim/api/keysets.lua#L184 Some API functions like nvim_cmd check for kObjectTypeDictionary and don't handle the case of empty Lua tables (treated as "Array"). Solution: Introduce VALIDATE_T_DICT and use it in places where kObjectTypeDictionary was being checked directly. fixes #21005
* feat: $NVIM_APPNAME #22128Ghjuvan Lacambre2023-02-16
| | | | | | | | | | | | | | | | | | | | This commit implements the ability to control all of the XDG paths Neovim should use. This is done by setting an environment variable named NVIM_APPNAME. For example, setting $NVIM_APPNAME makes Neovim look for its configuration directory in $XDG_CONFIG_HOME/$NVIM_APPNAME instead of $XDG_CONFIG_HOME/nvim. If NVIM_APPNAME is not set or is an empty string, "nvim" will be used as default. The usecase for this feature is to enable an easy way to switch from configuration to configuration. One might argue that the various $XDG environment variables can already be used for this usecase. However, setting $XDG environment variables also affects tools spawned by Neovim. For example, while setting $XDG_CONFIG_HOME will enable Neovim to use a different configuration directory, it will also prevent Git from finding its "default" configuration. Closes https://github.com/neovim/neovim/issues/21691
* vim-patch:9.0.1309: scrolling two lines with even line count and 'scrolloff' setzeertzjq2023-02-16
| | | | | | | | | | | Problem: Scrolling two lines with even line count and 'scrolloff' set. Solution: Adjust how the topline is computed. (closes vim/vim#10545) https://github.com/vim/vim/commit/1d6539cf36a7b6d1afe76fb6316fe662f543bf60 Cherry-pick test_scroll_opt.vim changes from patch 8.2.1432. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* Merge #22214 move init_default_autocmds to luaJustin M. Keyes2023-02-14
|\
| * refactor: move init_default_autocmds to luaglacambre2023-02-11
| | | | | | | | | | | | | | | | | | The original motivation for this change came from developping https://github.com/neovim/neovim/pull/22159, which will require adding more autocommand creation to Neovim's startup sequence. This change requires lightly editing a test that expected no autocommand to have been created from lua.
* | test: make expect_unchanged() less confusing (#22255)zeertzjq2023-02-15
| | | | | | | | | | | | | | | | Problem: The sleep before collecting the initial screen state is confusing and may lead to unexpected success if it comes after a blocking RPC call. Solution: Remove that sleep and add an "intermediate" argument.
* | refactor(api): consistent VALIDATE messages #22262Justin M. Keyes2023-02-14
| | | | | | | | | | | | | | | | | | | | Problem: Validation messages are not consistently formatted. - Parameter names sometimes are NOT quoted. - Descriptive names (non-parameters) sometimes ARE quoted. Solution: Always quote the `name` value passed to a VALIDATE macro _unless_ the value has whitespace.
* | Merge pull request #11756 from bfredl/crashfixbfredl2023-02-14
|\ \ | | | | | | custom statusline crash containing unprintable unicode
| * | fix(status): handle unprintable chars in the statuslineBjörn Linse2023-02-14
| | |
* | | Merge pull request #22108 from luukvbaal/statuscolumnLewis Russell2023-02-14
|\ \ \ | | | | | | | | perf(column): only build fold/sign column when present in 'statuscolumn'
| * | | perf(column): only build fold/sign column when present in 'statuscolumn'Luuk van Baal2023-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The fold and sign column is built and stored regardless of whether the corresponding item is present in 'statuscolumn'. Solution: Since the 'statuscolumn' parses itself, we can defer building the columns until the corresponding item is actually encountered.
* | | | refactor(api): VALIDATE macros #22256Justin M. Keyes2023-02-14
| | | | | | | | | | | | | | | | | | | | | | | | - VALIDATE() takes a format string - deduplicate check_string_array - VALIDATE_RANGE - validate UI args
* | | | test: remove unused field ext_float (#22243)zeertzjq2023-02-14
| | | |
* | | | refactor(api): VALIDATE macros #22187Justin M. Keyes2023-02-14
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | Problem: - API validation involves too much boilerplate. - API validation errors are not consistently worded. Solution: Introduce some macros. Currently these are clumsy, but they at least help with consistency and avoid some nesting.
* | | fix(folds): cursorline highlight is not always applied on closed folds (#22242)luukvbaal2023-02-14
| | | | | | | | | | | | | | | | | | | | | Problem: The cursorline highlight logic checks for `w_cursor.lnum` which may be different from the line number passed to `win_line()` even when the cursor is actually on that line. Solution: Update cursor line highlight logic to check for the line number of the start of a closed fold if necessary.
* | | fix(tui): exit on input eofzeertzjq2023-02-14
| | |
* | | test(tui_spec): remove unnecessary arguments for remote UIzeertzjq2023-02-14
| | |
* | | feat(filetype): fall back to file extension when matching from hashbang (#22140)Jonas Strittmatter2023-02-13
| | | | | | | | | | | | | | | | | | If nothing matched in match_from_hashbang, also check the file extension table. For a hashbang like '#!/bin/env foo', this will set the filetype to 'fooscript' assuming the filetype for the 'foo' extension is 'fooscript' in the extension table.
* | | Merge pull request #22191 from lewis6991/feat/playground_impLewis Russell2023-02-13
|\ \ \ | | | | | | | | feat(treesitter): playground improvements
| * | | 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.
* | | | build: don't check environment variable to detect CI (#22234)dundargoc2023-02-12
| | | | | | | | | | | | | | | | Instead use the cmake option, which should act as the definitive source to determine whether we use CI or not.
* | | | 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(client): wait for session to exitbfredl2023-02-10
| | | | | | | | | | | | | | | | | | This replicates the old native.pid_wait(self._pid) call, except using the proper libuv pattern (run loop unitil exit callback)
* | | 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.
* | build: create test/CMakeLists.txt and move test-related code (#22179)dundargoc2023-02-08
| | | | | | | | | | Having a clear separation between build code and test code makes it easier to get a higher-level understanding of how the neovim build works.
* | 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.