aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* | | fix(checkhealth): mitigate issues with duplicate healthchecks #15919Javier Lopez2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix(runtime/health): mitigate issues with duplicate healthchecks Previously if a healthcheck was found as Lua and Vim it was executed both times. This new implementations prefers Lua, therefore if two are found It only runs the Lua one, this way a plugin can mantain both implementations the Lua one with the method `check()` and the autoload function `#check()` (for none HEAD nvim versions). **Note: This will require plugins to use `check()` as the function name, since the autoload function that wraps the lua implementation won't be called** * docs(health): use spaces and don't overuse backtics followup to #15259
* | | feat(api): named marks set, get, delete #15346Javier Lopez2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the following API functions. - nvim_buf_set_mark(buf, name, line, col) * Set marks in a buffer. - nvim_buf_del_mark(buf, name) * Delete a mark that belongs to buffer. - nvim_del_mark(name) * Delete a global mark. - nvim_get_mark(name) * Get a global mark. Tests: - Adds test to all the new api functions, and adds more for the existing nvim_buf_get_mark. * Tests include failure cases. Documentation: - Adds documentation for all the new functions, and improves the existing fucntion docs.
* | | Merge pull request #15259 from muniter/muniter/checkhealth-from-luaMatthieu Coudron2021-10-05
|\ \ \ | | | | | | | | feat(checkhealth): support Lua healthchecks
| * | | feat(ex_checkhealth): provide function for command line completionJavier López2021-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move away from providing completion with ExpandRTDir to ExpandGeneric providing the function get_healthcheck_name which caches the results for the current command line prompt. It does the almost the same thing the Vim function 'get_healthcheck' implemented in 'runtime/autoload/health.vim' does.
| * | | test(runtime/health): cover lua healthchecksJavier López2021-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add tests for lua healthchecks (failure, success and submodules). - Reword some of the test naming for improved logs readability. - Modify render test to accomodate the changes of the health autoload function. - Add test for :checkhealth completion of Lua healtchecks.
* | | | Merge pull request #15813 from bfredl/neomouseBjörn Linse2021-10-04
|\ \ \ \ | |/ / / |/| | | fix(mouse): correct dragged position in composed layout
| * | | fix(mouse): correct dragged position in composed layoutBjörn Linse2021-10-04
| |/ /
* | | Merge #15218 from gpanders/split-trimemptyJustin M. Keyes2021-10-03
|\ \ \ | |/ / |/| | feat(lua): add "noempty" param to vim.split()
| * | refactor: use kwargs parameter in vim.splitGregory Anders2021-09-25
| | |
| * | feat: add trimempty optional parameter to vim.splitGregory Anders2021-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `split()` VimL function trims empty items from the returned list by default, so that, e.g. split("\nhello\nworld\n\n", "\n") returns ["hello", "world"] The Lua implementation of vim.split does not do this. For example, vim.split("\nhello\nworld\n\n", "\n") returns {'', 'hello', 'world', '', ''} Add an optional parameter to the vim.split function that, when true, trims these empty elements from the front and back of the returned table. This is only possible for vim.split and not vim.gsplit; because vim.gsplit is an iterator, there is no way for it to know if the current item is the last non-empty item. Note that in order to preserve backward compatibility, the parameter for the Lua vim.split function is `trimempty`, while the VimL function uses `keepempty` (i.e. they are opposites). This means there is a disconnect between these two functions that may surprise users.
* | | Merge pull request #15516 from bfredl/keysetBjörn Linse2021-10-03
|\ \ \ | | | | | | | | refactor(api): Represent option dicts as a structs in C and reduce conversion overhead from lua
| * | | refactor(api): handle option dicts properlyBjörn Linse2021-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not copy a lot of lua strings (dict keys) to just strequal() them Just compare them directly to a dedicated hash function. feat(generators): HASHY McHASHFACE
* | | | Merge pull request #15786 from gpanders/diagnostic-signs-unique-severityGregory Anders2021-10-02
|\ \ \ \
| * | | | test(diagnostic): add test case for signsGregory Anders2021-10-02
| | | | |
* | | | | fix(nvim_open_win): crash if autocmds delete buffer/window #15549Sean Dewar2021-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | win_set_buf can trigger autocmds if noautocmd=false. If they close the window, code afterwards will dereference the freed win_T* wp pointer. This interaction became possible after commit 1def3d1542d6a65f057e743faea39a760b50db87. The reason deleting curbuf crashes, and not the buf passed to `nvim_open_win`, is because the float initially edits curbuf (`win_init`) until it's later set to edit buf (windows from `:new` and `:split <buf>` behave similiarly: approx. `:split`, then `:buffer <buf>`). `do_buffer` closes windows when their edited buffer is deleted (unless it's the only window; N/A for floats), so the float closes when curbuf is deleted, so we need to check `win_valid` after `win_set_buf` too. Closes #15548
* | | | | fix(float)!: always anchor to corner of window including border #15832zeertzjq2021-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | N, W, S, E are all inclusive, i.e., always anchor to the exact corner of the window (including border). This line may also need change in this case (change 0 to -1): This is most consistent and easiest to reason about, especially with GUIs whose border do not need to have width/height of 1/1 in cell units. Fix #15789
* | | | | Merge #15803 fix(lsp_spec): tests depend on previous sessionJustin M. Keyes2021-10-02
|\ \ \ \ \
| * | | | | fix(lsp_spec): tests depended on previous sessionJustin M. Keyes2021-10-02
| | |/ / / | |/| | | | | | | | | | | | | - fix tests which accidentally depended on previous session
* | | | | fix(input): resolve isolated (non-ALT/META) mappings #13109erw72021-10-02
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Since 2f06413dfb36 #13042, "ESC+c" sequence is treated as "ESC c" instead of "M-c" (ALT/META+c) when not mapped, aka "fallthrough" behavior. But "isolated" (non-ALT/META) mappings to ESC and c were not resolved. This behavior is especially confusing for the TUI. Solution: Resolve isolated ESC, c mappings when there is no M-c mapping. Change ins_char_typebuf() to escape CSI, K_SPECIAL. fixes #13086 fixes #15869
* | | | fix(runtime): add packages as "/pack/*/start/*" patterns to &rtpBjörn Linse2021-10-02
|/ / / | | | | | | | | | This makes `globpath(&rtp, ...)` work again for start packages
* | | fix(runtime): fix ordering of "after" packagesBjörn Linse2021-09-30
| | | | | | | | | | | | they must come after ordinary runtime dirs which are not "after"
* | | test: add a test for getmousepos()Daniel Steinberg2021-09-29
| | |
* | | feat(lsp): add codeAction/resolve support (#15818)Mathias Fußenegger2021-09-28
| | | | | | | | | Closes https://github.com/neovim/neovim/issues/15339 and https://github.com/neovim/neovim/issues/15828
* | | Merge pull request #15812 from bfredl/tabaBjörn Linse2021-09-28
|\ \ \ | | | | | | | | fix(runtime): make a copy of runtime_search_path when iterating
| * | | fix(runtime): make a copy of runtime_search_path when iteratingBjörn Linse2021-09-27
| | | | | | | | | | | | | | | | | | | | This is to prevent concurrent modification, just like save_rtp in the vim 8 implementation
* | | | feat(lsp): add client command support to codelens (#15820)Mathias Fußenegger2021-09-28
| | | | | | | | | | | | | | | | Also adds a check against the server capabilities to fix https://github.com/neovim/neovim/issues/15183
* | | | fix(ui): s/format_entry/format_item to match docs (#15819)Mathias Fußenegger2021-09-27
| | | | | | | | | | | | Follow up to https://github.com/neovim/neovim/pull/15771
* | | | feat(ui): add vim.ui.select and use in code actions (#15771)Mathias Fußenegger2021-09-27
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuation of https://github.com/neovim/neovim/pull/15202 A plugin like telescope could override it with a fancy implementation and then users would get the telescope-ui within each plugin that utilizes the vim.ui.select function. There are some plugins which override the `textDocument/codeAction` handler solely to provide a different UI. With custom client commands and soon codeAction resolve support, it becomes more difficult to implement the handler right - so having a dedicated way to override the picking function will be useful.
* | | feat(lsp): use cjson for lsp rpc (#15759)Michael Lingelbach2021-09-26
| | |
* | | Merge pull request #14871 from mjlbach/feature/lua-cjson-embeddedMichael Lingelbach2021-09-26
|\ \ \ | | | | | | | | feat(lua): expose lua-cjson as vim.json
| * | | test: add tests for vim.jsonMichael Lingelbach2021-09-26
| | | |
* | | | Merge pull request #15351 from bfredl/virt_lineBjörn Linse2021-09-26
|\ \ \ \ | | | | | | | | | | feat(screen): virtual lines
| * | | | feat(decorations): support virtual lines (for now: only one block at a time)Björn Linse2021-09-26
| | | | |
* | | | | fix(runtime): ordering of loading packages with user configBjörn Linse2021-09-26
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | site packages must be sourced before user config NOTE: we only consider dirs exactly matching "after" to be an AFTER dir. vim8 considers all dirs like "foo/bar_after", "Xafter" etc, as an "after" dir in SOME codepaths not not in ALL codepaths.
* | / / fix(api): fix crash after set_option_value_for() #15390gmntroll2021-09-25
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: This crashes Nvim: tabedit call nvim_win_set_option(1000, 'statusline', 'status') split wincmd J wincmd j Solution: - Change `no_display` parameter value to be the same as in matching `restore_win_noblock` call. In case of different values `topframe` isn't restored to `curtab->tp_topframe`. - Call `restore_win_noblock` if `switch_win_noblock` returns `FAIL` (`switch_win` must always have matching `restore_win`) - Change `switch_win`/`restore_win` to `_noblock` versions to allow autocommands. fixes #14097 fixes #13577
* | | test(normal): CA_COMMAND_BUSY in visual select mode #15292Thomas Vigouroux2021-09-24
| | | | | | | | | | | | | | | | | | | | | | | | Fix was already applied in 5f144efefa66c9694123b679bab52992279a6015 #15688, but this commit adds another dimension to the test. Test correctly fails after reverting 5f144efefa66c9694123b679bab52992279a6015. ref #15288
* | | vim-patch:8.2.0924: cannot save and restore a register properlySean Dewar2021-09-23
|/ / | | | | | | | | | | | | | | | | | | | | Problem: Cannot save and restore a register properly. Solution: Add getreginfo() and make setreg() accept a dictionary. (Andy Massimino, closes vim/vim#3370) https://github.com/vim/vim/commit/bb861e293e0170455184079fa537278754b07911 Cherry-pick eval.txt changes for getreginfo() from: https://github.com/vim/vim/commit/6aa57295cfbe8f21c15f0671e45fd53cf990d404 https://github.com/vim/vim/commit/207f009326c8f878defde0e594d7d9ed9860106e
* | feat(diagnostic): allow customized diagnostic messages (#15742)Gregory Anders2021-09-22
| | | | | | | | Provide a 'format' option for virtual text and floating window previews that allows the displayed text of a diagnostic to be customized.
* | Merge pull request #14115 from mfussenegger/lsp-commandsMichael Lingelbach2021-09-22
|\ \ | | | | | | lsp: Add a registry for client side code action commands
| * | feat(lsp): add a registry for client side code action commandsMathias Fussenegger2021-09-20
| | | | | | | | | | | | | | | This builds on https://github.com/neovim/neovim/pull/14112 and closes https://github.com/neovim/neovim/issues/12326
| * | feat(lsp): include original request params in handler ctxMathias Fussenegger2021-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly motivated by https://github.com/neovim/neovim/issues/12326 Client side commands might need to access the original request parameters. Currently this is already possible by using closures with `vim.lsp.buf_request`, but the global handlers so far couldn't access the request parameters.
* | | feat(diagnostic): add option to include diagnostic sourceGregory Anders2021-09-21
| | | | | | | | | | | | | | | Add an option to virtual text display and floating window previews to include diagnostic source in the diagnostic message.
* | | fix(diagnostic): preserve fields from LSP diagnostics via user_data (#15735)masterGregory Anders2021-09-21
| | | | | | | | | * preserve fields from LSP diagnostics via adding a user_data table to the diagnostic, which can hold arbitrary data in addition to the lsp diagnostic information.
* | | fix(startup): init.lua: set $MYVIMRC to absolute path #15748Justin M. Keyes2021-09-21
|/ / | | | | | | | | | | - main.c: remove os_setenv("MYVIMRC",…), it is already done by do_source(). - This also sets $MYVIMRC to a full (absolute) path. - code cleanup.
* | fix(diagnostic): clamp line numbers in display layer (#15729)Gregory Anders2021-09-20
| | | | | | | | | | | | Some parts of LSP need to use cached diagnostics as sent from the LSP server unmodified. Rather than fixing invalid line numbers when diagnostics are first set, fix them when they are displayed to the user (e.g. in show() or one of the get_next/get_prev family of functions).
* | fix(inccommand): ignore trailing commands only for *previewed* command #15638itchyny2021-09-20
|/ | | | | | | | Since the `State` is global, other scripts are unexpectedly affected during the 'inccommand' preview. This commit introduces a new flag for `do_cmdline`, in order to ignore trailing '|'-separated commands only for the command invoking the preview. fix #8796, update #7494
* feat(diagnostic): match(), tolist(), fromlist() #15704Gregory Anders2021-09-19
| | | | | | * feat(diagnostic): add vim.diagnostic.match() Provide vim.diagnostic.match() to generate a diagnostic from a string and a Lua pattern. * feat(diagnostic): add tolist() and fromlist()
* refactor(tests): remove redir_exec #15718Justin M. Keyes2021-09-19
| | | | | | | | | | | Problem - `redir_exec` is obsolete, but it keeps getting used in new tests because people copy existing tests. - Disadvantages of `redir_exec`: - Captures extra junk before the actual error/message that we _want_ to test. - Does not fail on error, unlike e.g. `command()`. Solution - Use new functions like `nvim_exec` and `pcall_err`.
* feat(lsp): improve vim.lsp.util.apply_text_edits (#15561)hrsh7th2021-09-18
| | | | | - Fix the cursor position after applying TextEdits - Support reversed range of TextEdit - Invoke nvim_buf_set_text one by one
* Merge pull request #15710 from gpanders/show_line_diagnosticsMichael Lingelbach2021-09-18
|\ | | | | fix(diagnostic): resolve nil bufnr in show_line_diagnostics