aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua
Commit message (Collapse)AuthorAge
* feat(diagnostic): add `current_line` option for `virtual_text` handlerMaria José Solano2025-02-05
|
* feat(diagnostic): format() can filter diagnostics by returning nil #32302Maria José Solano2025-02-03
|
* fix(ui): avoid redundant ext_cmdline events (#32237)luukvbaal2025-01-29
| | | | | | | | Problem: `cmdline_show` is emitted unnecessarily each event loop iteration, because `cmdline_was_last_drawn` is never set. Solution: Keep track of whether the cmdline was last drawn to avoid unnecessarily emitting cmdline_show. Set `redraw_state` to emit `cmdline_pos` when emitting `CursorMovedC`. Only emit `cmdline_pos` when cmdline was last drawn.
* feat(diagnostic): virtual_lines #31959Maria José Solano2025-01-26
|
* fix(lua): pop retval for fast context LuaRefLuuk van Baal2025-01-24
| | | | | | Problem: nlua_call_ref_ctx() does not pop the return value in fast context that did not error. Solution: Fall through to end; calling nlua_call_pop_retval().
* fix(messages): avoid empty msg_showmode with 'noshowmode'Luuk van Baal2025-01-24
|
* test(lua/hl_spec): set timeout for transient state (#32169)zeertzjq2025-01-23
|
* feat(lua): vim.hl.range() "timeout" #32012Siddhant Agarwal2025-01-22
| | | | | | | | Problem: `vim.hl.on_yank()` has a "timeout" behavior but this is not available for `vim.hl.range()`. Solution: Add `timeout` arg to `vim.hl.range()`.
* vim-patch:9.1.1030: filetype: setting bash filetype is backwards incompatibleChristian Clason2025-01-20
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: setting bash filetype is backwards incompatible Solution: revert patch v9.1.0965, detect bash scripts again as sh filetype This reverts commit b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721. related: vim/vim#16309 https://github.com/vim/vim/commit/727c567a0934643e2d6e1dd92d4e636b17d9067f Co-authored-by: Christian Brabandt <cb@256bit.org> vim-patch:9.1.1033: tests: shaderslang was removed from test_filetype erroneously Problem: tests: shaderslang was removed from test_filetype erroneously (Christian Clason, after v9.1.1030) Solution: restore the test https://github.com/vim/vim/commit/1d2867df0c5dfa3d2444229f9e4b23d6ff935956 Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(lua): prevent SIGSEGV when lua error is NULL in libuv_worker林玮 (Jade Lin)2025-01-18
| | | | | | | | | | | | | Problem: Calling `xstrdup` with a NULL pointer causes a SIGSEGV if `lua_tostring` returns NULL in `nlua_luv_thread_common_cfpcall`. Crash stack trace: - `_platform_strlen` → `xstrdup` (memory.c:469) - `nlua_luv_thread_common_cfpcall` (executor.c:281) Solution: Check if `lua_tostring` returns NULL and pass NULL to `event_create` to avoid the crash.
* fix(diagnostic)!: make virtual text handler opt-in (#32079)Gregory Anders2025-01-18
| | | | | | | | | | | Making this opt-out (on by default) was the wrong choice from the beginning. It is too visually noisy to be enabled by default. BREAKING CHANGE: Users must opt-in to the diagnostic virtual text handler by adding vim.diagnostic.config({ virtual_text = true }) to their config.
* fix(cmdline): prevent cmdline_show events after exiting cmdline #32033luukvbaal2025-01-15
| | | | | | Problem: If a (vim.ui_attach) cmdline_hide callback triggers a redraw, it may cause cmdline_show events for an already exited cmdline. Solution: Avoid emitting cmdline_show event when ccline.cmdbuff is already NULL. Unset ccline.cmdbuff before emitting cmdline_hide.
* Merge #32001 from MariaSolOs/consistent-namespacesJustin M. Keyes2025-01-15
|\
| * refactor: use nvim.foo.bar format for namespacesMaria José Solano2025-01-14
| |
* | feat(vim.fs): find(), dir() can "follow" symlinks #31551Mike2025-01-14
|/ | | | | | | | Problem: vim.fs.dir(), vim.fs.find() do not follow symlinks. Solution: - Add "follow" flag. - Enable it by default.
* feat: add vim.fs.relpathdundargoc2025-01-13
| | | | | This is needed to replace the nvim-lspconfig function is_descendant that some lspconfg configurations still use.
* docs: misc #31867Justin M. Keyes2025-01-09
|
* Revert "refactor(options): set option value for non-current context ↵zeertzjq2025-01-09
| | | | | directly" (#31924) Reverts #31112
* Merge pull request #31112 from famiu/refactor/options/set_option_forLewis Russell2025-01-08
|\ | | | | refactor(options): set option value for non-current context directly
| * refactor(options): set option value for non-current context directlyFamiu Haque2024-12-26
| | | | | | | | | | | | Problem: Currently, we use `switch_option_context` to temporarily switch the current option context before setting an option for a different buffer / window. This is not ideal because we already support getting and setting option values for non-current contexts in the underlying implementation. Solution: Set option value for non-current context by passing the context directly to the lower level functions. Also introduce a new `OptCtx` struct to store option context information, this will scale much better if we add more option scopes and other context information in the future.
* | fix(vim.fs.normalize): normalize case for windows drive letterdundargoc2025-01-04
| | | | | | | | | | Also add tests for the current path casing behavior so it doesn't get accidentally changed.
* | test: use spawn_wait() instead of system() #31852Justin M. Keyes2025-01-04
| | | | | | | | | | | | | | | | | | | | | | Problem: Tests that need to check `nvim` CLI behavior (no RPC session) create their own ad-hoc `system()` wrappers. Solution: - Use `n.spawn_wait` instead of `system()`. - Bonus: this also improves the tests by explicitly checking for `stdout` or `stderr`. And if a signal is raised, `ProcStream.status` will reflect it.
* | feat(ui)!: emit prompt "messages" as cmdline events #31525luukvbaal2025-01-02
| | | | | | | | | | | | | | Problem: Prompts are emitted as messages events, where cmdline events are more appropriate. The user input is also emitted as message events in fast context, so cannot be displayed with vim.ui_attach(). Solution: Prompt for user input through cmdline prompts.
* | fix(vim.fs.abspath): correctly handle UNC pathsdundargoc2025-01-01
| |
* | docs: misc #31479Justin M. Keyes2025-01-01
| |
* | fix(vim.fs): joinpath() does not normalize slashes on Windows #31782Gustav Eikaas2024-12-31
| |
* | test: skip flaky watchdirs() test on macosdundargoc2024-12-31
| |
* | vim-patch:9.1.0965: filetype: sh filetype set when detecting the use of bash ↵Luca Saccarola2024-12-28
| | | | | | | | | | | | | | | | | | | | | | (#31749) Problem: filetype: sh filetype set when detecting the use of bash Solution: when bash is detected, use 'bash' filetype instead (Luca Saccarola) closes: vim/vim#16309 https://github.com/vim/vim/commit/b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721
* | feat(lua): add `vim.fs.abspath`Famiu Haque2024-12-28
|/ | | | | | Problem: There is currently no way to check if a given path is absolute or convert a relative path to an absolute path through the Lua stdlib. `vim.fs.joinpath` does not work when the path is absolute. There is also currently no way to resolve `C:foo\bar` style paths in Windows. Solution: Add `vim.fs.abspath`, which allows converting any path to an absolute path. This also allows checking if current path is absolute by doing `vim.fs.abspath(path) == path`. It also has support for `C:foo\bar` style paths in Windows.
* feat(ui): specify whether msg_show event is added to historyLuuk van Baal2024-12-23
| | | | | Pass along whether message in msg_show event is added to the internal :messages history.
* feat(ui): additional arguments for cmdline_show/hide eventsLuuk van Baal2024-12-22
| | | | | | | | Problem: Unable to tell what highlight the prompt part of a cmdline_show event should have, and whether cmdline_hide was emitted after aborting. Solution: Add additional arguments hl_id to cmdline_show, and abort to cmdline_hide.
* feat(terminal)!: cursor shape and blink (#31562)Gregory Anders2024-12-17
| | | | | | | | | | | | | | | | | | | | | When a terminal application running inside the terminal emulator sets the cursor shape or blink status of the cursor, update the cursor in the parent terminal to match. This removes the "virtual cursor" that has been in use by the terminal emulator since the beginning. The original rationale for using the virtual cursor was to avoid having to support additional UI methods to change the cursor color for other (non-TUI) UIs, instead relying on the TermCursor and TermCursorNC highlight groups. The TermCursor highlight group is now used in the default 'guicursor' value, which has a new entry for Terminal mode. However, the TermCursorNC highlight group is no longer supported: since terminal windows now use the real cursor, when the window is not focused there is no cursor displayed in the window at all, so there is nothing to highlight. Users can still use the StatusLineTermNC highlight group to differentiate non-focused terminal windows. BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
* fix(api): generic error messages, not using TRY_WRAP #31596Justin M. Keyes2024-12-16
| | | | | | | | | | | Problem: - API functions using `try_start` directly, do not surface the underlying error message, and instead show generic messages. - Error-handling code is duplicated in the API impl. - Failure modes are not tested. Solution: - Use `TRY_WRAP`. - Add tests.
* fix(diagnostic): vim.diagnostic.setqflist() opens loclist on first call #31585Juan Cruz De La Torre2024-12-16
| | | | | | | | | | | | Problem: Regression from de794f2d2409: `vim.diagnostic.setqflist{open=true}` attempts to open the location list instead of the diagnostics quickfix list if it didn't exist before. This is because we are using `qf_id` to decide which to open, but `qf_id=nil` when there is no existing diagnostics quickfix list with a given title ("Diagnostics" by default). Solution: - Revert to using `loclist` to decide which to open. - Add tests.
* fix(uri): uri_encode encodes brackets incorrectly for RFC2732 #31284Jonny Kong2024-12-11
| | | | | | | | | | **Problem:** The brackets in the RFC2732 regular expression are currently unescaped, causing them to be misinterpreted as special characters denoting character groups rather than as literal characters. **Solution:** Escape the brackets. Fix #31270
* fix(lua): avoid vim._with() double-free with cmdmod (#31505)zeertzjq2024-12-08
|
* feat(stdlib): vim.json.encode(...,{escape_slash:boolean}) #30561Bartłomiej Maryńczak2024-12-06
| | | | | | | | | | | | Problem: vim.json.encode escapes every slash in string values (for example in file paths), and is not optional. Use-case is for preventing HTML injections (eg. injecting `</script>` closing tag); in the context of Nvim this is rarely useful. Solution: - Add a `escape_slash` flag to `vim.json.encode`. - Defaults to `false`. (This is a "breaking" change, but more like a bug fix.)
* fix(filetype): make filetype detection work with :doautocmd (#31470)zeertzjq2024-12-06
|
* test(system_spec): check for .git dir before using git (#31458)zeertzjq2024-12-05
|
* Merge #31358 fix test failures for release / tarball buildsJustin M. Keyes2024-12-04
|\
| * test(main_spec): use CMakePresets.json instead of .git for root markerJames McCoy2024-12-03
| |
* | fix(vim.system): close pipe handles after process handleLewis Russell2024-12-04
|/ | | | Fixes #30846
* perf(vim.text): use lookup table implementation for hex encoding (#30080)Gregory Anders2024-11-26
| | | Co-authored-by: glepnir <glephunter@gmail.com>
* fix(lua): remove vim.loader.disable() #31344Justin M. Keyes2024-11-26
| | | | | | | | | | | | | | Problem: `vim.loader.disable` does not conform to `:help dev-name-common` and `:help dev-patterns`. Solution: - Add `enable` parameter to `vim.loader.enable` - Remove `vim.loader.disable` - Note the change in `:help news-breaking-dev` (HEAD changes). - This is not a breaking change (except to "HEAD") because `vim.loader` is marked "experimental". previous: 26765e8461c1ba1e9a351632212cf89900221781
* test(filetype): symlink detection works after expand('<afile>') (#31307)zeertzjq2024-11-22
| | | Also add a test for #31306, which currently fails.
* docs: misc (#31138)dundargoc2024-11-21
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(messages): more ext_messages kinds #31279luukvbaal2024-11-20
| | | | Add kinds for various commands that output a list, the 'wildmode' list, and for number prompts.
* fix(api): nvim_get_option_value does not clean up on FileType error #31219altermo2024-11-18
| | | | | | | | Problem: If there's an error in `FileType` autocmd, the filetype get-opt buffer doesn't get cleaned up. Solution: Call `aucmd_restbuf`.
* fix(messages): proper multiline Lua print() messages #31205luukvbaal2024-11-17
| | | | | | Problem: Separate message emitted for each newline present in Lua print() arguments. Solution: Make msg_multiline() handle NUL bytes. Refactor print() to use msg_multiline(). Refactor vim.print() to use print().
* test(lua/ui_event_spec): avoid polluting log file (#31229)zeertzjq2024-11-16
|