aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* fix(api, lua): make blank lines in a message work properly (#24244)zeertzjq2023-07-04
|
* fix(plines): handle inline virtual text after last char (#24241)zeertzjq2023-07-03
| | | Also remove dead code in win_lbr_chartabsize().
* test: check for ASAN properly (#24224)zeertzjq2023-07-02
| | | Follow-up to #24195.
* vim-patch:9.0.1672: tabline highlight wrong after truncated double width ↵zeertzjq2023-07-02
| | | | | | | | label (#24223) Problem: Tabline highlight wrong after truncated double width label. Solution: Fill up half a double width character later. (closes vim/vim#12614) https://github.com/vim/vim/commit/d392a74c5a8af8271a33a20d37ae1a8ea422cb4b
* fix(startup)!: "nvim -l" message does not end with newline #24215zeertzjq2023-07-01
| | | Close #24180
* fix(api): nvim_parse_cmd error message in pcall() #23297Alexandre Teoi2023-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: nvim_parse_cmd() in pcall() may show an error message (side-effect): :lua pcall(vim.api.nvim_parse_cmd, vim.fn.getcmdline(), {}) E16: Invalid range Solution: Avoid emsg() in the nvim_parse_cmd() codepath. - refactor(api): add error message output parameter to get_address() - fix: null check emsg() parameter - refactor: remove emsg_off workaround from do_incsearch_highlighting() - refactor: remove emsg_off workaround from cmdpreview_may_show() - refactor: remove remaining calls to emsg() from parse_cmd_address() and get_address() - (refactor): lint set_cmd_dflall_range() - refactor: addr_error() - move output parameter to return value Fix #20339 TODO: These are the functions called by `get_address()`: ``` nvim_parse_cmd() -> parse_cmdline() -> parse_cmd_address() -> get_address() skipwhite() addr_error() qf_get_cur_idx() qf_get_cur_valid_idx() qf_get_size() qf_get_valid_size() mark_get() mark_check() assert() skip_regexp() magic_isset() > do_search() > searchit() ascii_isdigit() getdigits() getdigits_int32() compute_buffer_local_count() hasFolding() ``` From these functions, I found at least two that call emsg directly: - do_search() - seems to be simple to refactor - searchit() - will be more challenging because it may generate multiple error messages, which can't be handled by the current `errormsg` out-parameter. For example, it makes multiple calls to `vim_regexec_multi()` in a loop that possibly generate error messages, and later `searchit()` itself may generate another one: - https://github.com/neovim/neovim/blob/c194acbfc479d8e5839fa629363f93f6550d035c/src/nvim/search.c#L631-L647 - https://github.com/neovim/neovim/blob/c194acbfc479d8e5839fa629363f93f6550d035c/src/nvim/search.c#L939-L954 --------- Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* feat(version): unverbose ":version", ":verbose version" #24195Justin M. Keyes2023-07-01
| | | | | | | | | Problem: `nvim -v` and `:version` prints system vimrc, fallback files, and compilation info by default, which most people don't care about and just clutters up the output. Solution: Omit extra info unless 'verbose' is set.
* feat(treesitter): bundle markdown parser and queries (#22481)Christian Clason2023-07-01
| | | | | | | * bundle split Markdown parser from https://github.com/MDeiml/tree-sitter-markdown * add queries from https://github.com/nvim-treesitter/nvim-treesitter/tree/main * upstream `#trim!` and `#inject-language!` directives Co-authored-by: dundargoc <gocdundar@gmail.com>
* fix(startup): don't truncate when printing with -l (#24216)zeertzjq2023-07-01
|
* Merge pull request #24147 from clason/fix/ftpluginzeertzjq2023-06-30
|\ | | | | fix(ftplugin): respect runtimepath ordering
| * test(lua/runtime_spec): add test for ftplugin orderingzeertzjq2023-06-30
| |
* | feat(lsp): move inlay_hint() to vim.lsp (#24130)Mathias Fußenegger2023-06-30
| | | | | | | | | | | | Allows to keep more functions hidden and gives a path forward for further inlay_hint related functions - like applying textEdits. See https://github.com/neovim/neovim/pull/23984#pullrequestreview-1486624668
* | fix(statusline): fill for double-width char after moving items (#24207)zeertzjq2023-06-30
| |
* | fix(column): handle unprintable chars in 'statuscolumn' (#24198)zeertzjq2023-06-29
| |
* | test(statusline): add test with control characters (#24197)zeertzjq2023-06-29
| |
* | fix(api): nvim_cmd{cmd="win_getid"} parsed as :winsize #24181Justin M. Keyes2023-06-28
| | | | | | | | | | | | | | | | Problem: `:lua vim.cmd.win_getid(30,10)` is interpreted as `:win[size] 30 10`. User intention was to call `vim.fn.win_getid(30,10)`. Solution: Check that the `cmd` actually matches the resolved command.
* | vim-patch:9.0.1670: resetting local option to global value is inconsistent ↵zeertzjq2023-06-28
| | | | | | | | | | | | | | | | | | | | | | (#24185) Problem: Resetting local option to global value is inconsistent. Solution: Handle "<" specifically for 'scrolloff' and 'sidescrolloff'. (closes vim/vim#12594) https://github.com/vim/vim/commit/bf5f189e449d6517239b79804d7a422a46946838 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | fix(treesitter): make foldexpr work without highlighting (#24167)Jaehwang Jung2023-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Treesitter fold is not updated if treesitter hightlight is not active. More precisely, updating folds requires `LanguageTree:parse()`. Solution: Call `parse()` before computing folds and compute folds when lines are added/removed. This doesn't guarantee correctness of the folds, because some changes that don't add/remove line won't update the folds even if they should (e.g. adding pair of braces). But it is good enough for most cases, while not introducing big overhead. Also, if highlighting is active, it is likely that `TSHighlighter._on_buf` already ran `parse()` (or vice versa).
* | vim-patch:9.0.1668: PEM files are not recognized (#24169)ObserverOfTime2023-06-27
| | | | | | | | | | | | Problem: PEM files are not recognized. Solution: Add patterns to match PEM files. (closes vim/vim#12582) https://github.com/vim/vim/commit/0256d76a3392aef270b38d1cf7633008e45c2003
* | vim-patch:9.0.1667: regression test doesn't fail when fix is revertedzeertzjq2023-06-27
| | | | | | | | | | | | | | | | Problem: Regression test doesn't fail when fix is reverted. Solution: Add "n" to 'cpoptions' instead of using :winsize. (closes vim/vim#12587, issue vim/vim#12528) https://github.com/vim/vim/commit/e42989374144a63d986b878618aeac328e35ac3b
* | vim-patch:9.0.1664: divide by zero when scrolling with 'smoothscroll' setzeertzjq2023-06-27
| | | | | | | | | | | | | | | | | | Problem: Divide by zero when scrolling with 'smoothscroll' set. Solution: Avoid using a negative width. (closes vim/vim#12540, closes vim/vim#12528) https://github.com/vim/vim/commit/8154e642aa476e1a5d3de66c34e8289845b2b797 Co-authored-by: fullwaywang <fullwaywang@tencent.com>
* | vim-patch:9.0.1632: not all cabal config files are recognized (#24025)Jonas Strittmatter2023-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Not all cabal config files are recognized. Solution: Add a couple of patterns. (Marcin Szamotulski, closes vim/vim#12463) https://github.com/vim/vim/commit/166cd7b801ebe4aa042a9bbd6007d1951800aaa9 Also: - Do not expand Lua patterns in environment variables used in file patterns. - Test $XDG_CONFIG_HOME on Windows, as it can be used by Nvim (and the runner sets it). Co-authored-by: Marcin Szamotulski <coot@coot.me>
* | fix(startup): "nvim -l foo.lua" may not set arg0 #24161Mike2023-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Using "nvim -l args.lua" without passing extra script args, does not set `_G.arg[0]`. Steps to reproduce: ``` cat > args.lua<<EOF vim.print(_G.arg, '') vim.print(vim.v.argv, '') EOF nvim --clean -l args.lua ``` Solution: Fix condition in command_line_scan.
* | fix(charset): fix wrong display of 0xffff (#24158)zeertzjq2023-06-26
| |
* | vim-patch:9.0.1665: empty CmdlineEnter autocommand causes errors in Ex modezeertzjq2023-06-26
| | | | | | | | | | | | | | | | | | | | Problem: Empty CmdlineEnter autocommand causes errors in Ex mode. Solution: Save and restore ex_pressedreturn. (Christian Brabandt, closes # 12581, closes vim/vim#12578) https://github.com/vim/vim/commit/590aae35575cbd74d80c41d87fc647f2812aad70 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | Merge #24116 from justinmk/docJustin M. Keyes2023-06-25
|\ \
| * | fix(docs): vimdoc syntax errorsJustin M. Keyes2023-06-25
| | | | | | | | | | | | gen_help_html: truncate parse-error sample text
* | | vim-patch:9.0.1661: BUCK files are not recognized (#24142)Christian Clason2023-06-24
| |/ |/| | | | | | | | | | | | | Problem: BUCK files are not recognized. Solution: Recognize BUCK files as "bzl". (Son Luong Ngoc, closes vim/vim#12564) https://github.com/vim/vim/commit/b46e0f3263acd99c61df06ee3c4d1f6e0b471bc3 Co-authored-by: Son Luong Ngoc <sluongng@gmail.com>
* | test(extmarks): add a test for #23848 (#24140)zeertzjq2023-06-24
| |
* | Merge pull request #24082 from smjonas/fix_24064Christian Clason2023-06-24
|\ \ | | | | | | fix(filetype): correctly detect bash-fc-{id} files as "sh" (vim-patch:9.0.1644)
| * | vim-patch:9.0.1644: not all filetype file name matches are testedsmjonas2023-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Not all filetype file name matches are tested. Solution: Add more file names to test with. (Jonas Strittmatter, closes vim/vim#12569) https://github.com/vim/vim/commit/bd087ae8f07f026bbd179911830027ff92f42c01 Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
* | | fix(extmarks): fix heap buffer overflow caused by inline virtual text (#23851)Ibby2023-06-24
| |/ |/| | | also fixes an edge case where the extends character would not be drawn if the real text exactly fits the grid.
* | fix(cmdline): don't redraw 'tabline' in Ex mode (#24123)zeertzjq2023-06-23
| | | | | | | | | | | | | | | | Redrawing of 'statusline' and 'winbar' are actually already inhibited by RedawingDisabled in Ex mode. In Vim there is a check for `msg_scrolled == 0` (which is false in Ex mode) since Vim doesn't have msgsep. Add a `!exmode_active` check here in Nvim instead.
* | feat(lsp): opt-in to dynamicRegistration for inlay hints (#24102)Mathias Fußenegger2023-06-22
| | | | | | | | | | Since https://github.com/neovim/neovim/pull/23681 there is dynamic registration support. We should use that for new features unless there is a good reason to turn it off.
* | vim-patch:9.0.1645: zserio files are not recognized (#24120)Christian Clason2023-06-22
| | | | | | | | | | | | | | | | | | Problem: zserio files are not recognized. Solution: Add a pattern for zserio files. (Dominique Pellé, closes vim/vim#12544) https://github.com/vim/vim/commit/2b994da57a0ac6ec0ec09fe3783f48ecd2bce610 Co-authored-by: =?UTF-8?q?Dominique=20Pell=C3=A9?= <dominique.pelle@gmail.com>
* | feat(extmarks): support hl_mode "combine" for inline virt_text (#24099)zeertzjq2023-06-22
| |
* | fix(messages): use "Vimscript" instead of "VimL" #24111Justin M. Keyes2023-06-22
| | | | | | | | followup to #24109 fix #16150
* | test: spellcheck :help (vimdoc) files #24109Justin M. Keyes2023-06-22
| | | | | | | | | | | | | | Enforce consistent terminology (defined in `gen_help_html.lua:spell_dict`) for common misspellings. This does not spellcheck English in general (perhaps a future TODO, though it may be noisy).
* | fix(extmarks): hide inline virt_text properly with 'smoothscroll' (#24106)zeertzjq2023-06-22
| |
* | fix(extmarks): empty inline virt_text interfering with DiffText (#24101)zeertzjq2023-06-22
| |
* | fix(api): wrong nvim_buf_set_extmark error for invalid hl_modezeertzjq2023-06-22
| |
* | fix(extmarks): empty inline virt_text interfering with Visual highlightzeertzjq2023-06-22
| |
* | fix(folds): don't show search or match highlighting on fold (#24084)zeertzjq2023-06-21
| |
* | fix(vim.json)!: remove global options, "null", "array_mt" #24070Justin M. Keyes2023-06-21
|/ | | | | | | | | | | | | | | | | | | | | | | | | Problem: - `vim.json` exposes various global options which: - affect all Nvim Lua plugins (especially the LSP client) - are undocumented and untested - can cause confusing problems such as: https://github.com/codota/tabnine-nvim/commit/cc76ae3abe2f129d44b5a8edee2529e0ee0dcf69 - `vim.json` exposes redundant mechanisms: - `vim.json.null` is redundant with `vim.NIL`. - `array_mt` is redundant because Nvim uses a metatable (`vim.empty_dict()`) for empty dict instead, which `vim.json` is configured to use by default (see `as_empty_dict`). Example: ``` :lua vim.print(vim.json.decode('{"bar":[],"foo":{}}')) --> { bar = {}, foo = vim.empty_dict() } ``` Thus we don't need to also decorate empty arrays with `array_mt`. Solution: Remove the functions from the public vim.json interface. Comment-out the implementation code to minimize drift from upstream. TODO: - Expose the options as arguments to `vim.json.new()`
* fix(lsp): always return boolean in lsp.buf_client_attach (#24077)Sooryakiran Ponnath2023-06-20
| | | Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
* refactor(lsp): extract common execute command functionality (#24065)Mathias Fußenegger2023-06-20
|
* feat(lsp): inlay hints #23984Chinmay Dalal2023-06-19
| | | | | | | | | | | Add automatic refresh and a public interface on top of #23736 * add on_reload, on_detach handlers in `enable()` buf_attach, and LspDetach autocommand in case of manual detach * unify `__buffers` and `hint_cache_by_buf` * use callback bufnr in `on_lines` callback, bufstate: remove __index override * move user-facing functions into vim.lsp.buf, unify enable/disable/toggle Closes #18086
* docs #22363Justin M. Keyes2023-06-19
| | | | | | | | | Co-authored by: zeertzjq <zeertzjq@outlook.com> Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com> Co-authored by: nobe4 <nobe4@users.noreply.github.com> - docs: mention --luadev-mod to run with lua runtime files When changing a lua file in the ./runtime folder, a new contributor might expect changes to be applied to the built Neovim binary.
* fix(fs): make `normalize()` work with '/' path (#24047)Evgeni Chasnovski2023-06-18
| | | | | | | Problem: Current implementation of "remove trailing /" doesn't account for the case of literal '/' as path. Solution: Remove trailing / only if it preceded by something else. Co-authored by: notomo <notomo.motono@gmail.com>
* fix(lsp): allow Lua pattern chars in code action filter (#24041)Jonas Strittmatter2023-06-17
| | | | | | | Previously, filtering code actions with the "only" option failed if the code action kind contained special Lua pattern chars such as "-" (e.g. the ocaml language server supports a "type-annotate" code action). Solution: use string comparison instead of string.find