aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
| * | vim-patch:8.2.3378: MS-Windows: completing environment variables with % is wrongSean Dewar2021-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: MS-Windows: completing environment variables with % is wrong. Solution: Only complete environment variables with $. (Albert Liu, closes vim/vim#8791) https://github.com/vim/vim/commit/6024c0427ce1196344439997d5e41a6f8546368c The change itself in set_one_cmd_context() is N/A (it was never included in Neovim to begin with). N/A patches for version.c: vim-patch:8.2.3379: crash when using NULL job Problem: Crash when using NULL job. Solution: Copy static string into buffer. (issue vim/vim#8260) https://github.com/vim/vim/commit/271906bc067a8f25422016665001d2e44cf618e2
* | | fix: prevent K_EVENT from stopping Select mode CTRL-O #15688zeertzjq2021-09-17
| | | | | | | | | | | | | | | | | | When using Goneovim, Select mode `CTRL-O` returns back to Select mode immediately (even with `--clean`). Neovim TUI (with some plugins) also randomly returns to Select mode even if no keys are pressed when using `CTRL-O` in Select mode.
* | | Merge #15693 fix(diagnostics)Justin M. Keyes2021-09-17
|\ \ \ | | | | | | | | fix(diagnostics): fixup for `show_line_diagnostics` and `lsp.diagnostics.get`
| * | | fix(diagnostic): don't convert diagnostic table twiceChristian Clason2021-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recursive implementation of vim.lsp.diagnostic.get() applied `diagnostic_vim_to_lsp` twice, and the second time gave wrong results because of the unexpected format. Fixes https://github.com/neovim/neovim/issues/15689
| * | | fix(diagnostic): show_line_diagnostic with empty lnumChristian Clason2021-09-17
|/ / / | | | | | | | | | | | | | | | | | | The documentation claims to default to the current line number if the argument `lnum` is nil, but that was never actually done. Fixes https://github.com/neovim/neovim/issues/15690
* | | fix(diagnostic): nvim_echo takes three args (#15687)Christian Clason2021-09-17
| | | | | | | | | | | | Fixup for https://github.com/neovim/neovim/pull/15585 Closes https://github.com/neovim/neovim/issues/15686
* | | fix(diagnostic): remove useless highlight links (#15683)Gregory Anders2021-09-17
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These links were actually defined backwards: the highlight groups actually being used for display are the new "Diagnostic*" groups, so linking the old "LspDiagnostics*" groups to these does absolutely nothing, since there is nothing actually being highlighted with the LspDiagnostics* groups. These links were made in an attempt to preserve backward compatibility with existing colorschemes. We could reverse the links to maintain this preservation, but then that disallows us from actually defining default values for the new highlight groups. Instead, just remove the links and be done with the old LspDiagnostics* highlight groups. This is not technically a breaking change: the breaking change already happened in #15585, but this PR just makes that explicit.
* | fix(diagnostic): don't override existing highlight groups #15682Gregory Anders2021-09-16
| | | | | | | | | | Use the 'default' keyword to prevent overriding existing highlight groups. ref #15585
* | Merge pull request #15668 from bfredl/logmenuBjörn Linse2021-09-16
|\ \ | | | | | | fix(tests): don't attempt to call ui functions in free_all_mem()
| * | fix(ui): don't log from UI events during free_all_mem()Björn Linse2021-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example assertion failure: %0 in logmsg neovim/src/nvim/log.c:139:17 %1 in ui_call_update_menu neovim/build/src/nvim/auto/ui_events_call.generated.h:8:3 %2 in ex_menu neovim/src/nvim/menu.c:263:3 %3 in do_one_cmd neovim/src/nvim/ex_docmd.c:1981:5 %4 in do_cmdline neovim/src/nvim/ex_docmd.c:602:20 %5 in do_cmdline_cmd neovim/src/nvim/ex_docmd.c:287:10 %6 in free_all_mem neovim/src/nvim/memory.c:596:3 %7 in os_exit neovim/src/nvim/main.c:574:3 %8 in exit_event neovim/src/nvim/msgpack_rpc/channel.c:569:5
* | | Merge #15585 refactor: move vim.lsp.diagnostic to vim.diagnosticJustin M. Keyes2021-09-16
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Overview - Move vim.lsp.diagnostic to vim.diagnostic - Refactor client ids to diagnostic namespaces - Update tests - Write/update documentation and function signatures Currently, non-LSP diagnostics in Neovim must hook into the LSP subsystem. This is what e.g. null-ls and nvim-lint do. This is necessary because none of the diagnostic API is exposed separately from the LSP subsystem. This commit addresses this by generalizing the diagnostic subsystem beyond the scope of LSP. The `vim.lsp.diagnostic` module is now simply a specific diagnostic producer and primarily maintains the interface between LSP clients and the broader diagnostic API. The current diagnostic API uses "client ids" which only makes sense in the context of LSP. We replace "client ids" with standard API namespaces generated from `nvim_create_namespace`. This PR is *mostly* backward compatible (so long as plugins are only using the publicly documented API): LSP diagnostics will continue to work as usual, as will pseudo-LSP clients like null-ls and nvim-lint. However, the latter can now use the new interface, which looks something like this: ```lua -- The namespace *must* be given a name. Anonymous namespaces will not work with diagnostics local ns = vim.api.nvim_create_namespace("foo") -- Generate diagnostics local diagnostics = generate_diagnostics() -- Set diagnostics for the current buffer vim.diagnostic.set(ns, diagnostics, bufnr) ``` Some public facing API utility methods were removed and internalized directly in `vim.diagnostic`: * `vim.lsp.util.diagnostics_to_items` ## API Design `vim.diagnostic` contains most of the same API as `vim.lsp.diagnostic` with `client_id` simply replaced with `namespace`, with some differences: * Generally speaking, functions that modify or add diagnostics require a namespace as their first argument, e.g. ```lua vim.diagnostic.set({namespace}, {bufnr}, {diagnostics}[, {opts}]) ``` while functions that read or query diagnostics do not (although in many cases one may be supplied optionally): ```lua vim.diagnostic.get({bufnr}[, {namespace}]) ``` * We use our own severity levels to decouple `vim.diagnostic` from LSP. These are designed similarly to `vim.log.levels` and currently include: ```lua vim.diagnostic.severity.ERROR vim.diagnostic.severity.WARN vim.diagnostic.severity.INFO vim.diagnostic.severity.HINT ``` In practice, these match the LSP diagnostic severity levels exactly, but we should treat this as an interface and not assume that they are the same. The "translation" between the two severity types is handled transparently in `vim.lsp.diagnostic`. * The actual "diagnostic" data structure is: (**EDIT:** Updated 2021-09-09): ```lua { lnum = <number>, col = <number>, end_lnum = <number>, end_col = <number>, severity = <vim.diagnostic.severity>, message = <string> } ``` This differs from the LSP definition of a diagnostic, so we transform them in the handler functions in vim.lsp.diagnostic. ## Configuration The `vim.lsp.with` paradigm still works for configuring how LSP diagnostics are displayed, but this is a specific use-case for the `publishDiagnostics` handler. Configuration with `vim.diagnostic` is instead done with the `vim.diagnostic.config` function: ```lua vim.diagnostic.config({ virtual_text = true, signs = false, underline = true, update_in_insert = true, severity_sort = false, }[, namespace]) ``` (or alternatively passed directly to `set()` or `show()`.) When the `namespace` argument is `nil`, settings are set globally (i.e. for *all* diagnostic namespaces). This is what user's will typically use for their local configuration. Diagnostic producers can also set configuration options for their specific namespace, although this is generally discouraged in order to respect the user's global settings. All of the values in the table passed to `vim.diagnostic.config()` are resolved in the same way that they are in `on_publish_diagnostics`; that is, the value can be a boolean, a table, or a function: ```lua vim.diagnostic.config({ virtual_text = function(namespace, bufnr) -- Only enable virtual text in buffer 3 return bufnr == 3 end, }) ``` ## Misc Notes * `vim.diagnostic` currently depends on `vim.lsp.util` for floating window previews. I think this is okay for now, although ideally we'd want to decouple these completely.
| * | | fix(lint): remove unused parameters from deprecated functionsGregory Anders2021-09-16
| | | |
| * | | fix(lint): remove unused function from diagnostic specGregory Anders2021-09-16
| | | |
| * | | refactor: remove UTF to byte col conversionGregory Anders2021-09-16
| | | |
| * | | test: add test case for severity rangesGregory Anders2021-09-15
| | | |
| * | | refactor: move vim.lsp.diagnostic to vim.diagnosticGregory Anders2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This generalizes diagnostic handling outside of just the scope of LSP. LSP clients are now a specific case of a diagnostic producer, but the diagnostic subsystem is decoupled from the LSP subsystem (or will be, eventually). More discussion at [1]. [1]: https://github.com/neovim/neovim/pull/15585
* | | | Merge pull request #15211 from seandewar/blob-portJan Edmund Lazo2021-09-16
|\ \ \ \ | | | | | | | | | | Port VimL's Blob type - vim-patch:8.1.{0735,0736,0738,0741,0742,0755,0756,0757,0765,0793,0797,0798,0802,1022,1023,1671},8.2.{0121,0184,0404,0521,0829,1473,1866,2712}
| * | | | vim-patch:8.2.1866: Vim9: appending to pushed blob gives wrong resultSean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: appending to pushed blob gives wrong result. Solution: Set ga_maxlen when copying a blob. https://github.com/vim/vim/commit/66fa5fd54f550c0790d36c20124c49493b323bfa Vim9script is N/A.
| * | | | doc(eval): include latest relevant Blob changesSean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also includes some small relevant nearby non-Blob changes and typo fixes. Changes are included from: - v8.1.0815 - v8.1.0846 - v8.1.1084 - v8.1.2326 - v8.2.1969 - d89682477c - d09091d495 - 53f7fccc94
| * | | | test(oldtest): unskip existing tests that use BlobsSean Dewar2021-09-16
| | | | |
| * | | | feat(f_msgpackparse): support parsing from BlobSean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that it is not possible for msgpack_unpack_next() and msgpack_unpacker_next() to return MSGPACK_UNPACK_EXTRA_BYTES, so it should be fine to abort() on that. Lua 5.1 doesn't support string hex escapes (\xXX) like VimL does (though LuaJIT does), so convert them to decimal escapes (\DDD) in tests.
| * | | | fix(test/dumplog): tostring(rv) before formatting as stringSean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, implicitly converting a table to a string works in LuaJIT, but needs to be done explicitly with tostring() in Lua 5.1. This can cause issues when testing a non-JIT build if eq(), for example, fails with a table argument. E.g: eq({}, {1}) will not print the details of the assertion failure, but will instead print a less helpful "string expected, got table" error.
| * | | | feat(f_msgpackdump): support dumping to BlobSean Dewar2021-09-16
| | | | |
| * | | | feat(f_chansend): support Blob data argumentSean Dewar2021-09-16
| | | | |
| * | | | fix(eval): partially port v8.2.3284Sean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were issues that I found while porting that I fixed upstream. :^) Very little of the patch can be exactly ported as we're a bit behind on dependant patches (we also can't use the exact :for emsg, as we don't support iterating over Strings yet), so just translate the fixes as best as we can for now. Include latest relevant doc changes from: - v8.1.0815 - v8.2.2658
| * | | | fix(f_remove): partially port v8.2.2779Sean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes remove() copying one extra byte after the end of a Blob's buffer. Can't be fully ported as the change is from blob_remove(), which hasn't been ported yet.
| * | | | vim-patch:8.2.2712: memory leak when adding to a blob failsSean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Memory leak when adding to a blob fails. Solution: Clear the second typval before returning. https://github.com/vim/vim/commit/f2dd9cb9958962302d33fab8fe6439645a2d1e1b
| * | | | vim-patch:8.2.1473: items in a list given to :const can still be modifiedSean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Items in a list given to :const can still be modified. Solution: Work like ":lockvar! name" but don't lock referenced items. Make locking a blob work. https://github.com/vim/vim/commit/021bda56710d98c09a6b35610a476ab2dd8c58ad
| * | | | vim-patch:8.2.0829: filter() may give misleading error messageSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filter() may give misleading error message. Solution: Also mention Blob as an allowed argument. https://github.com/vim/vim/commit/fcb0b61d15f66f0e9116a6bc56d9d8105bb913cf Rename Test_map_fails() to Test_map_filter_fails() from v8.2.0610 and include the modeline.
| * | | | fix(f_insert): partially port v8.2.0634Sean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | Fixes a crash in f_insert() when inserting into a NULL blob. Include blob-related test changes and some other simple changes.
| * | | | vim-patch:8.2.0521: crash when reading a blob failsSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Crash when reading a blob fails. Solution: Avoid keeping a pointer to a freed blob object. (Dominique Pelle, closes vim/vim#5890) Adjust error messages. https://github.com/vim/vim/commit/15352dc6ec43fd50cc3be4f4fd1ad74d5619da20
| * | | | vim-patch:8.2.0404: writefile() error does not give a hintSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Writefile() error does not give a hint. Solution: Add remark about first argument. https://github.com/vim/vim/commit/18a2b87ca27c378a555b20f14a284d2ce3511427
| * | | | vim-patch:8.2.0184: blob test failsSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Blob test fails. Solution: Check for different error when float feature is missing. https://github.com/vim/vim/commit/92be6e3f46120bb8e6c8fca0a7868a08df8b3345 Nvim always has the float feature, but include the changes to the test anyway.
| * | | | vim-patch:8.2.0121: filter() and map() on blob don't workSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filter() and map() on blob don't work. Solution: Correct the code. (closes vim/vim#5483) https://github.com/vim/vim/commit/49c57ce50019b667e5005ce1cfb8cdc2e48bf868
| * | | | vim-patch:8.1.1671: copying a blob may result in it being lockedSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Copying a blob may result in it being locked. Solution: Reset v_lock. (Ken Takata, closes vim/vim#4648) https://github.com/vim/vim/commit/b7b9efbccfe17ee3f7b1bb877b7745d5bfbf0804
| * | | | vim-patch:8.1.1023: may use NULL pointer when indexing a blobSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: May use NULL pointer when indexing a blob. (Coverity) Solution: Break out of loop after using index on blob https://github.com/vim/vim/commit/61be376337b0374d55a4b1d8206b2ec87ca54252
| * | | | vim-patch:8.1.0802: negative index doesn't work for BlobSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Negative index doesn't work for Blob. Solution: Make it work, add a test. (closes vim/vim#3856) https://github.com/vim/vim/commit/a5be9b62480a6f338a72c01e57c9edd0bca8048b Leave tv_blob_get()'s return type untouched.
| * | | | vim-patch:8.1.0798: changing a blob while iterating over it works strangelySean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Changing a blob while iterating over it works strangely. Solution: Make a copy of the Blob before iterating. https://github.com/vim/vim/commit/dd29ea18050284526174b5685781469240f5bc4a
| * | | | vim-patch:8.1.0797: error E898 is used twiceSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Error E898 is used twice. Solution: Rename the Blob error to E899. (closes vim/vim#3853) https://github.com/vim/vim/commit/bf821bccf18453b01d25bee53e4954b02a5dd0e6
| * | | | vim-patch:8.1.0793: incorrect error messages for functions that take a BlobSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Incorrect error messages for functions that now take a Blob argument. Solution: Adjust the error messages. (Dominique Pelle, closes vim/vim#3846) https://github.com/vim/vim/commit/0d17f0d1c09fa6db306336695ba646c21ea24909
| * | | | vim-patch:8.1.0765: string format of a Blob can't be parsed backSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: String format of a Blob can't be parsed back. Solution: Use 0z format. https://github.com/vim/vim/commit/4131fd5509b283e978e8c6161f09643b64719787
| * | | | vim-patch:8.1.0757: not enough documentation for BlobsSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Not enough documentation for Blobs. Solution: Add a section about Blobs. https://github.com/vim/vim/commit/d89682477cd01ec60edd6d88093b95b12e180127 Include doc changes for empty() from v7.4.1274. Include some minor typo fixes.
| * | | | vim-patch:8.1.0756: copy() does not make a copy of a BlobSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: copy() does not make a copy of a Blob. Solution: Make a copy. https://github.com/vim/vim/commit/3d28b58c519c9fc3427587201423c74746cc219e Replace vim_memsave() with xmemdup().
| * | | | vim-patch:8.1.0755: error message for get() on a Blob with invalid indexSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Error message for get() on a Blob with invalid index. Solution: Return an empty Blob, like get() on a List does. https://github.com/vim/vim/commit/2ea773b468a1143214c2f12b91ab5e1e7abb4a14
| * | | | vim-patch:8.1.0742: not all Blob operations are testedSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Not all Blob operations are tested. Solution: Add more testing for Blob. https://github.com/vim/vim/commit/05500ece6282407f9f7227aaf564e24147326863 Test_readfile_binary is already ported.
| * | | | vim-patch:8.1.0738: using freed memory, for loop over blob leaks memorySean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Using freed memory, for loop over blob leaks memory. Solution: Clear pointer after freeing memory. Decrement reference count after for loop over blob. https://github.com/vim/vim/commit/ecc8bc482ba601b9301a6c129c92a0d1f8527f72
| * | | | feat(decode_string): decode binary string with NULs to BlobSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strings that previously decoded into a msgpack special for representing BINs with NULs now convert to Blobs. It shouldn't be possible to decode into this special anymore after this change? Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
| * | | | feat(shada): restore Blob globals properlySean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Strings and Blobs are encoded as msgpack BINs, the current ShaDa implementation will restore global Blob variables as Strings (or msgpack special dicts if they contain NULs). Encode an additional element with Blob globals to differentiate them from Strings so that we can restore them with the correct type. Adjust variables_spec.lua's autotest() to also check for proper type.
| * | | | feat(msgpack): convert Blobs to BIN stringsSean Dewar2021-09-15
| | | | |
| * | | | feat(json): convert Blobs to array of byte valuesSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | Similiar to how Vim does it, but to be consistent with how Nvim encodes lists, add a space after every comma.