aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* Merge pull request #28492 from bfredl/hotfixbfredl2024-04-25
|\ | | | | fix(lua): vim.fn.has('nvim-0.10') in fast context, used by vim.deprecate
| * fix(lua): vim.fn.has('nvim-0.10') in fast context, used by vim.deprecatebfredl2024-04-25
| |
* | feat(fs): add vim.fs.root (#28477)Gregory Anders2024-04-24
| | | | | | | | | | | | vim.fs.root() is a function for finding a project root relative to a buffer using one or more "root markers". This is useful for LSP and could be useful for other "projects" designs, as well as for any plugins which work with a "projects" concept.
* | feat(api): allow floats to be opened in non-current tabpage (#28480)Will Hopkins2024-04-25
|/ | | \
* refactor(lsp): merge subtypes and supertypes into typehierarchy (#28467)Mathias Fußenegger2024-04-23
| | | | Both methods had pretty much the same documentation and shared the implementation.
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
* perf(lua): faster vim.deprecate() #28470Evgeni Chasnovski2024-04-23
| | | | | | | | | | | | Problem: `vim.deprecate()` can be relatively significantly slower than the deprecated function in "Nvim" plugin. Solution: Optimize checks for "Nvim" plugin. This also results into not distinguishing "xxx-dev" and "xxx" versions when doing checks, which is essentially covered by the deprecation logic itself. With this rewrite I get the times from #28459: `{ 0.024827, 0.003797, 0.002024, 0.001774, 0.001703 }`. For quicker reference: - On current Nightly it is something like `{ 3.72243, 0.918169, 0.968143, 0.763256, 0.783424 }`. - On 0.9.5: `{ 0.002955, 0.000361, 0.000281, 0.000251, 0.00019 }`.
* fix(diagnostic): vim.diagnostic.get(…,{lnum=…}) on multi-line diagnostic ↵Raphael2024-04-23
| | | | | | | | #28273 Problem: vim.diagnostic.get(…,{lnum=…}) does not match multi-line diagnostics. Solution: add end_lnum support.
* fix(diagnostic): open_float on multi-line diagnostics #28301Raphael2024-04-23
| | | | | Problem: when diagnostic have a range of line, open_float not work. Solution: filter diagnostic by line number range.
* vim-patch:9.1.0366: filetype: ondir files are not recognizedChristian Clason2024-04-23
| | | | | | | | | | | | Problem: filetype: ondir files are not recognized Solution: Detect '.ondirrc' as ondir filetype (Jon Parise) closes: vim/vim#14604 https://github.com/vim/vim/commit/ea999037a41292b3d3e00700a87a82fe5d2c12b2 Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:9.1.0364: tests: test_vim9_builtin is a bit slow (#28466)zeertzjq2024-04-23
| | | | | | | | | | | | | | Problem: tests: test_vim9_builtin is a bit slow Solution: source tests from a buffer instead of writing and sourcing a file (Yegappan Lakshmanan) closes: vim/vim#14614 https://github.com/vim/vim/commit/22697b6179e38f3d321b1495ef17f06031a9c8f1 N/A patch: vim-patch:9.1.0299: Vim9: return type not set for a lambda assigned to script var Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.1.0365: Crash when typing many keys with D- modifier (#28464)zeertzjq2024-04-23
| | | | | | | | | Problem: Crash when typing many keys with D- modifier (after 9.1.0227). Solution: Don't treat a 0x80 byte inside a special sequence as the start of a special sequence (zeertzjq). closes: vim/vim#14613 https://github.com/vim/vim/commit/6b13e3d4e46393b3a35eed7c27ae020bcbd46a9b
* vim-patch:9.1.0357: Page scrolling should place cursor at window boundaries ↵luukvbaal2024-04-22
| | | | | | | | | | (#28429) Problem: Page scrolling does not always place the cursor at the top or bottom of the window (Mathias Rav) Solution: Place the cursor at the top or bottom of the window. (Luuk van Baal) https://github.com/vim/vim/commit/4b6b0c4024df08dd8ce49dff3c76356ff81190c4
* fix(completion): check that healthcheck name is string (#28458)zeertzjq2024-04-22
|
* Merge pull request #28434 from glepnir/23120bfredl2024-04-22
|\ | | | | fix(float): wrong position when bufpos is out of range
| * fix(float): wrong position when bufpos is setglepnir2024-04-21
| | | | | | | | | | | | Problem: when lnum in bufpos is out of range the position of float is wired. Solution: avoid the height value out of buffer line range.
* | fix(window): don't go to unfocusable float when closing (#28455)zeertzjq2024-04-22
| |
* | refactor(lua): deprecate tbl_flattenJustin M. Keyes2024-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Besides being redundant with vim.iter():flatten(), `tbl_flatten` has these problems: - Has `tbl_` prefix but only accepts lists. - Discards some results! Compare the following: - iter.flatten(): ``` vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable() ``` - tbl_flatten: ``` vim.tbl_flatten({1, { { a = 2 } }, { 3 } }) ``` Solution: Deprecate tbl_flatten. Note: iter:flatten() currently fails ("flatten() requires a list-like table") on this code from gen_lsp.lua: local anonym = vim.iter({ -- remove nil anonymous_num > 1 and '' or nil, '---@class ' .. anonymous_classname, }):flatten():totable() Should we enhance :flatten() to work for arrays?
* | vim-patch:9.1.0363: tests: test_winfixbuf is a bit slow (#28446)zeertzjq2024-04-22
| | | | | | | | | | | | | | | | | | | | | | Problem: tests: test_winfixbuf is a bit slow Solution: use defer if possible, reset hidden option, use --not-a-term when starting Vim using system() (Yegappan Lakshmanan) closes: vim/vim#14611 https://github.com/vim/vim/commit/4baf908d60e526737090701048a09aa474fde73d Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | refactor(lua): rename tbl_isarray => isarrayJustin M. Keyes2024-04-21
| | | | | | | | | | | | | | tbl_isarray was not released yet, so it will not go through a deprecation cycle. ref #24572
* | refactor(lua): rename tbl_islist => islistJustin M. Keyes2024-04-21
| | | | | | | | ref #24572
* | Merge pull request #27872 from luukvbaal/cmdheightbfredl2024-04-21
|\ \ | | | | | | fix(ui): don't force 'cmdheight' to zero with ext_messages
| * | fix(ui): don't force 'cmdheight' to zero with ext_messagesLuuk van Baal2024-04-20
| | | | | | | | | | | | Remove remaining code that prevents non-zero 'cmdheight' with ext_messages.
* | | fix(api): do not update grid position in nvim_win_set_cursor (#28235)luukvbaal2024-04-21
| | | | | | | | | | | | Revert commit c971f538ab87b537ae4c97bd44167661c5691a2d. Forcing grid cursor position will need a new API like originally proposed in #27858.
* | | feat(treesitter): handle quantified fold capturesRiley Bruins2024-04-20
| | |
* | | refactor(lua): "module" => "M" #28426Justin M. Keyes2024-04-20
|/ / | | | | | | Most of the codebase uses the `M` convention for Lua module. Update the last remaining cases.
* | feat(lsp): add vim.lsp.buf.subtypes(), vim.lsp.buf.supertypes() (#28388)Yinzuo Jiang2024-04-20
| | | | | | | | Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com> Co-authored-by: Maria José Solano <majosolano99@gmail.com>
* | fix(vim.ui.open): try wslview before explorer.exe #28424Justin M. Keyes2024-04-20
|/ | | | | | | | | Problem: explorer.exe is unreliable on WSL. Solution: Try wslview before explorer.exe. fix #28410
* fix(showcmd): clear the rest properly (#28420)zeertzjq2024-04-20
|
* vim-patch:9.1.0355: filetype: flake.lock files are not recognizedChristian Clason2024-04-19
| | | | | | | | | | | | Problem: filetype: flake.lock files are not recognized Solution: Detect 'flake.lock' as json filetype (Riley Bruins) closes: vim/vim#14589 https://github.com/vim/vim/commit/ce736033ae86e14e8b1a56a3e4843c7ab24e48d2 Co-authored-by: Riley Bruins <ribru17@hotmail.com>
* vim-patch:9.1.0354: runtime(uci): No support for uci file types (#28409)zeertzjq2024-04-19
| | | | | | | | | | | | | Problem: runtime(uci): No support for uci file types (Wu, Zhenyu) Solution: include basic uci ftplugin and syntax plugins (Colin Caine) closes: vim/vim#14575 https://github.com/vim/vim/commit/4b3fab14dbde971f15d8783e9ef125b19fdbc829 Co-authored-by: Colin Caine <complaints@cmcaine.co.uk> Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0351: No test that completing a partial mapping clears ↵zeertzjq2024-04-19
| | | | | | | | | | | 'showcmd' (#28406) Problem: No test that completing a partial mapping clears 'showcmd'. Solution: Complete partial mappings in Test_showcmd_part_map() instead of using :echo. Adjust some comments (zeertzjq). closes: vim/vim#14580 https://github.com/vim/vim/commit/094c4390bdf3473fab122aa02883e63ce4e66cdb
* feat(lua): enable(enable:boolean, filter:table) #28374Justin M. Keyes2024-04-18
| | | | | | | | | | | | | Problem: We need to establish a pattern for `enable()`. Solution: - First `enable()` parameter is always `enable:boolean`. - Update `vim.diagnostic.enable()` - Update `vim.lsp.inlay_hint.enable()`. - It was not released yet, so no deprecation is needed. But to help HEAD users, it will show an informative error. - vim.deprecate(): - Improve message when the "removal version" is a *current or older* version.
* refactor(lsp): merge rpc.domain_socket_connect into rpc.connect (#28398)Mathias Fußenegger2024-04-18
| | | See discussion in https://github.com/neovim/neovim/pull/26850
* test: 'showcmd' with ext_messages and Visual selection (#28393)zeertzjq2024-04-18
| | | Also slightly reorder some code to make comments look less out-of-place.
* vim-patch:9.1.0343: 'showcmd' wrong for partial mapping with multibyte (#28392)zeertzjq2024-04-18
| | | | | | | | | | | | | | | | | | | | | | Problem: 'showcmd' is wrong for partial mapping with multibyte char, and isn't very readable with modifyOtherKeys. Solution: Decode multibyte char and merge modifiers into the char. (zeertzjq) This improves the following situations: - Multibyte chars whose individual bytes are considered unprintable are now shown properly in 'showcmd' area. - Ctrl-W with modifyOtherKeys now shows ^W in 'showcmd' area. The following situation may still need improvement: - If the char is a special key or has modifiers that cannot be merged into it, internal keycodes are shown in 'showcmd' area like before. This applies to keys typed in Normal mode commands as well, and it's hard to decide how to make it more readable due to the limited space taken by 'showcmd', so I'll leave it for later. closes: vim/vim#14572 https://github.com/vim/vim/commit/acdfb8a97995e0f81832207e39564ba795281108
* vim-patch:9.1.0344: Cursor wrong after using setcellwidth() in terminal (#28391)zeertzjq2024-04-18
| | | | | | | | | | | | | | | | | Problem: Cursor wrong after using setcellwidth() in terminal (mikoto2000) Solution: output additional spaces, so the behaviour matches the GUI (mikoto2000) fixes: vim/vim#14539 closes: vim/vim#14540 Fix CUI `setcellwidths` characters draw behavior to same GUI behavior. https://github.com/vim/vim/commit/e20fa59903525e15cecd680a2f32ece8a5d1bc0c This is already fixed and tested in Nvim in #28322. Co-authored-by: mikoto2000 <mikoto2000@gmail.com>
* vim-patch:9.1.0341: Problem: a few memory leaks are found (#28382)zeertzjq2024-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: a few memory leaks are found (LuMingYinDetect ) Solution: properly free the memory Fixes the following problems: - Memory leak in f_maplist() fixes: vim/vim#14486 - Memory leak in option.c fixes: vim/vim#14485 - Memory leak in f_resolve() fixes: vim/vim#14484 - Memory leak in f_autocmd_get() related: vim/vim#14474 - Memory leak in dict_extend_func() fixes: vim/vim#14477 fixes: vim/vim#14238 closes: vim/vim#14517 https://github.com/vim/vim/commit/29269a71b5ac8a87c6c4beca35c173a19a2c9398 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0340: Problem: Error with matchaddpos() and empty list (#28381)zeertzjq2024-04-17
| | | | | | | | | | | | Problem: Error with matchaddpos() and empty list (@rickhow) Solution: Return early for an empty list fixes: vim/vim#14525 closes: vim/vim#14563 https://github.com/vim/vim/commit/f7d31adcc22eae852d6e7a5b59e9755ba7b51d35 Co-authored-by: Christian Brabandt <cb@256bit.org>
* test: API can return Lua function to Lua code (#28380)zeertzjq2024-04-17
|
* fix(lua): only free luarefs when returning from API (#28373)zeertzjq2024-04-17
|
* feat(lua): vim.fs.normalize() resolves ".", ".." #28203Famiu Haque2024-04-16
| | | | | | | | | | | | | | | | | | | | | Problem: `vim.fs.normalize` does not resolve `.` and `..` components. This makes no sense as the entire point of normalization is to remove redundancy from the path. The path normalization functions in several other languages (Java, Python, C++, etc.) also resolve `.` and `..` components. Reference: - Python: https://docs.python.org/3/library/os.path.html#os.path.normpath - Java: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#normalize-- - C++: https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal Solution: Resolve "." and ".." in `vim.fs.normalize`. Before: "~/foo/bar/../baz/./" => "~/foo/bar/../baz/." After: "~/foo/bar/../baz/./" => "~/foo/baz"
* fix(api): ignore 'autochdir' when renaming other buf (#28376)zeertzjq2024-04-16
| | | | | | Problem: Renaming non-current buffer changes working directory when 'autochdir' is set. Solution: Temporarily disable 'autochdir'. Add more tests for the win_set_buf change.
* fix(api): ignore 'autochdir' when setting buf in other win (#28371)Raphael2024-04-16
| | | | | Problem: Wrong working directory when setting buffer in another window with 'autochdir' enabled. Solution: Temporarily disable 'autochdir'.
* Merge #28227 feat(diagnostic): is_enabled, enable(…, enable:boolean)Justin M. Keyes2024-04-16
|\
| * feat(diagnostic): enable(…, opts)Justin M. Keyes2024-04-15
| | | | | | | | | | | | | | | | | | | | Problem: vim.diagnostic.enable() does not match the signature of vim.lsp.inlay_hint.enable() Solution: - Change the signature so that the first 2 args are (bufnr, enable). - Introduce a 3rd `opts` arg. - Currently it only supports `opts.ns_id`.
| * feat(diagnostic): is_enabled, enable(…, enable:boolean)Justin M. Keyes2024-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `vim.diagnostic.is_disabled` and `vim.diagnostic.disable` are unnecessary and inconsistent with the "toggle" pattern (established starting with `vim.lsp.inlay_hint`, see https://github.com/neovim/neovim/pull/25512#pullrequestreview-1676750276 As a reminder, the rationale is: - we always need `enable()` - we always end up needing `is_enabled()` - "toggle" can be achieved via `enable(not is_enabled())` - therefore, - `toggle()` and `disable()` are redundant - `is_disabled()` is a needless inconsistency Solution: - Introduce `vim.diagnostic.is_enabled`, and `vim.diagnostic.enable(…, enable:boolean)` - Note: Future improvement would be to add an `enable()` overload `enable(enable:boolean, opts: table)`. - Deprecate `vim.diagnostic.is_disabled`, `vim.diagnostic.disable`
* | test: make mapping tests more consistent (#28368)zeertzjq2024-04-16
| | | | | | | | | | | | - Test maparg() and maplist() in the same test. - Use matches() instead of string.match(). - Avoid overlong lines and strange spacing in exec_lua(). - Revert code change from last PR as the variable may be needed.
* | test: getting autocmd Lua callback in Vimscript (#28367)zeertzjq2024-04-16
| | | | | | Also remove unnecessary variable in API converter.
* | fix(messages): avoid crash with :intro and ch=0 (#28343)zeertzjq2024-04-16
| | | | | | | | This just copies code from msg_start() to wait_return(). Not sure if there is a better place to put such a block.