aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* ci(PVS): PVS/V009: add required header #15751dundargoc2021-09-21
|
* 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.
* refactor: reformat with uncrustify #15736dundargoc2021-09-20
| | | | * fix function parameter comments * remove space after star in function names
* 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
* refactor: format with uncrustify #15726dundargoc2021-09-20
|
* refactor: format with uncrustify #15722dundargoc2021-09-19
|
* vim-patch:8.2.3437: compiler warnings for 32/64 bit usagezeertzjq2021-09-19
| | | | | | Problem: Compiler warnings for 32/64 bit usage. Solution: Add type casts. (Mike Williams, closes vim/vim#8870) https://github.com/vim/vim/commit/f5785cf0592626ec17676e814d3ba58f5123bcda
* vim-patch:8.2.3425: warning for using uninitialized variablezeertzjq2021-09-19
| | | | | | Problem: Warning for using uninitialized variable. Solution: Initialize it. (John Marriott) https://github.com/vim/vim/commit/56e14698b45a9c4ef8fa65c55c9bfe86fbb3d6bf
* vim-patch:8.2.3424: a sequence of spaces is hard to see in list modezeertzjq2021-09-19
| | | | | | Problem: A sequence of spaces is hard to see in list mode. Solution: Add the "multispace" option to 'listchars'. (closes vim/vim#8834) https://github.com/vim/vim/commit/f14b8ba1373f569705cb80419248054100b02360
* vim-patch:8.2.2640: screenstring() returns non-existing composing characterszeertzjq2021-09-19
| | | | | | Problem: screenstring() returns non-existing composing characters. Solution: Only use composing characters if there is a base character. https://github.com/vim/vim/commit/f1387285e2ebe5cb3688d729fc6fd01a169a76c1
* vim-patch:8.1.1110: composing chars on space wrong when 'listchars' is setzeertzjq2021-09-19
| | | | | | | Problem: Composing chars on space wrong when 'listchars' is set. Solution: Do not use "space" and "nbsp" entries of 'listchars' when there is a composing character. (Yee Cheng Chin, closes vim/vim#4197) https://github.com/vim/vim/commit/e5e4e22c1c15c8c22b14935affe969569acc8df9
* vim-patch:8.1.1079: no need for a separate ScreenLinesUtf8() test functionzeertzjq2021-09-19
| | | | | | Problem: No need for a separate ScreenLinesUtf8() test function. Solution: Get the composing characters with ScreenLines(). https://github.com/vim/vim/commit/48aed0824e47147faf19fc235ad4bcf851584c9c
* vim-patch:8.1.1078: when 'listchars' is set a composing char on a space is wrongzeertzjq2021-09-19
| | | | | | | Problem: When 'listchars' is set a composing char on a space is wrong. Solution: Separate handling a non-breaking space and a space. (Yasuhiro Matsumoto, closes vim/vim#4046) https://github.com/vim/vim/commit/5f8069bbf5d989936a2f4d7a76ae42434017e3a2
* vim-patch:8.1.1071: cannot get composing characters from the screenzeertzjq2021-09-19
| | | | | | | Problem: Cannot get composing characters from the screen. Solution: Add screenchars() and screenstring(). (partly by Ozaki Kiichi, closes vim/vim#4059) https://github.com/vim/vim/commit/2912abb3a2fd72074e3901c8ae1d4a77ce764675
* vim-patch:8.2.3394: filler lines are wrong when changing text in diff mode ↵Jaehwang Jerry Jung2021-09-18
| | | | | | | | (#15547) Problem: Filler lines are wrong when changing text in diff mode. Solution: Don't change the filler lines on every change. Check scrollbinding when updating the filler lines. (closes vim/vim#8809) https://github.com/vim/vim/commit/04626c243c47af91c2580eaf23e12286180e0e81
* refactor: format #15702dundargoc2021-09-18
|
* refactor(runtime): handle pack/foo/start/bar/after dirs properlyBjörn Linse2021-09-18
| | | | | | | | The order should be: XDG_CONFIG_HOME/nvim XDG_DATA_HOME/nvim/site/pack/foo/start/bar/ XDG_CONFIG_HOME/nvim/after XDG_DATA_HOME/nvim/site/pack/foo/start/bar/after
* refactor(runtime): always use DIP_START when searching for runtime filesBjörn Linse2021-09-18
| | | | | | | | Now remove the addition of "start/*" packages in 'packpath' as explicit items in 'runtimepath'. This avoids 'runtimepath' from becoming very long when using a lot of plugins as packages. To get the effective search path as a list, use |nvim_list_runtime_paths()|
* refactor: convert TRUE/FALSE to true/false (#15660)dundargoc2021-09-18
|
* fix(typo): overriden -> overridden (RE: PR #14159) (#15360)Oliver Marriott2021-09-17
|
* Merge pull request #15364 from seandewar/vim-8.2.3337Jan Edmund Lazo2021-09-17
|\ | | | | vim-patch:8.2.{3286,3289,3293,3298,3313,3321,3328,3330,3331,3337,3354,3355,3357,3360,3369,3375}
| * vim-patch:8.2.3375: using uninitialized memorySean Dewar2021-09-17
| | | | | | | | | | | | | | | | Problem: Using uninitialized memory. Solution: Initialize textprop_save_len. https://github.com/vim/vim/commit/df9070e300dabf0c54de87a75973a80adb38afa3 textprop_save_len is N/A.
| * vim-patch:8.2.3369: auto formatting after "cw" leaves cursor in wrong spotSean Dewar2021-09-17
| | | | | | | | | | | | Problem: Auto formatting after "cw" leaves cursor in wrong spot. Solution: Do not auto-format after the delete. (closes vim/vim#8789) https://github.com/vim/vim/commit/6b36d2a16d7931bac82ef8b5654c68ac456b24bf
| * vim-patch:8.2.3360: user function completion fails with dict functionSean Dewar2021-09-17
| | | | | | | | | | | | | | | | Problem: User function completion fails with dict function. Solution: Do not stop sequencing through the list if user functions when encountering an empty name. (Naohiro Ono, closes vim/vim#8765, closes vim/vim#8774) https://github.com/vim/vim/commit/5aec755b678cfd434b8ea2158d06992f33e1ff80
| * vim-patch:8.2.3357: crash when 'virtualedit' is set and window is narrowSean Dewar2021-09-17
| | | | | | | | | | | | Problem: Crash when 'virtualedit' is set and window is narrow. () Solution: Check that width is not zero. (closes vim/vim#8767) https://github.com/vim/vim/commit/02f8694a6bd116ab3316add4a7ea6735bf2e8839
| * vim-patch:8.2.3337: completing "call g:" returns entries with just "g:"Sean Dewar2021-09-17
| | | | | | | | | | | | Problem: Completing "call g:" returns entries with just "g:". (Naohiro Ono) Solution: Skip empty strings returned by get_user_func_name(). (closes vim/vim#8753) https://github.com/vim/vim/commit/069f90852f1444cac50491c10dfbd339a3f9e0c8
| * vim-patch:8.2.3330: Coverity reports using uninitialized fieldSean Dewar2021-09-17
| | | | | | | | | | | | Problem: Coverity reports using uninitialized field. Solution: Initialize the field early. https://github.com/vim/vim/commit/7deb4115ef72c0468cd6f9cc5f036d5c405641d4
| * vim-patch:8.2.3328: Coverity error for not checking return valueSean Dewar2021-09-17
| | | | | | | | | | | | Problem: Coverity error for not checking return value. Solution: Check value is not negative. https://github.com/vim/vim/commit/b85d3627d9a7b41d603c58a16d0ddbf6b88beeaf
| * vim-patch:8.2.3321: some code is not testedSean Dewar2021-09-17
| | | | | | | | | | | | | | | | | | Problem: Some code is not tested. Solution: Add some more tests. (Dominique Pellé, closes vim/vim#8735) https://github.com/vim/vim/commit/bd9e7961256ea6a98bd5a7bfe14e32c4c47186e6 Include Test_confirm_write_partial_file() anyway, even though it will not be run.
| * vim-patch:8.2.3313: unused code in win_exchange() and frame_remove()Sean Dewar2021-09-17
| | | | | | | | | | | | Problem: Unused code in win_exchange() and frame_remove(). Solution: Remove the code. (closes vim/vim#8728) https://github.com/vim/vim/commit/9e2fa4bb9eb40a78a1ae1f67a4064651b5ce0aac
| * vim-patch:8.2.3293: finding completions may cause an endless loopSean Dewar2021-09-17
| | | | | | | | | | | | | | Problem: Finding completions may cause an endless loop. Solution: Use a better way to check coming back where the search started. (Andy Gozas, closes vim/vim#8672, closes vim/vim#8671) https://github.com/vim/vim/commit/6a230c6b32695393785ae64b440ce5f023a22382
| * vim-patch:8.2.3286: win_enter_ext() has too many boolean argumentsSean Dewar2021-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: win_enter_ext() has too many boolean arguments. Solution: use one flags argument with defined values. https://github.com/vim/vim/commit/d61f2f772a59617850e9aa2f5fa069c1aad8e074 Include some style changes to appease the linter. N/A patches for version.c: vim-patch:8.2.3289: compiler warning for unused variable with small features Problem: Compiler warning for unused variable with small features. Solution: Rearrange #ifdefs. https://github.com/vim/vim/commit/f18e8a969a3414ed5e6b7159c40fe43963021ff3 vim-patch:8.2.3298: build failure with small features Problem: Build failure with small features. Solution: Add #ifdef. https://github.com/vim/vim/commit/6f6d58c3809010b1386634c1aeec61f1a66e72c2 vim-patch:8.2.3331: Coverity warns for using value without boundary check Problem: Coverity warns for using value without boundary check. Solution: Add a boundary check. https://github.com/vim/vim/commit/ed7cb2df35244e40e5c4df06169b50e705427576 vim-patch:8.2.3354: build failure with +byte_offset but without +textprop Problem: Build failure with +byte_offset but without +textprop. (John Marriott) Solution: Adjust the #ifdef. https://github.com/vim/vim/commit/92755bba30ec7a4c72ae0280420ba5c3847a9385 vim-patch:8.2.3355: MS-Windows: compiler warning for 64-32 bit conversion Problem: MS-Windows: compiler warning for 64-32 bit conversion. Solution: Add type casts. https://github.com/vim/vim/commit/434df7a401c92d4084bb0a01ffd6d1737ae0193b
* | refactor(style): switch-case formatting, "uncrustify:indent-off" #15669dundargoc2021-09-17
| | | | | | | | | | | | * refactor: disable formatting for attribute in macro * fixup: disable/enable uncrustify with uncrustify:indent-off/on * fixup: stop indenting contents inside braces in case * fixup: remove case brace if no variable declaration
* | Merge pull request #15580 from seandewar/vim-8.2.3378Jan Edmund Lazo2021-09-17
|\ \ | | | | | | vim-patch:8.2.{3378,3379,3384,3386,3398,3400}
| * | vim-patch:8.2.3400: ":z!" is not supportedSean Dewar2021-09-10
| | | | | | | | | | | | | | | | | | | | | Problem: ":z!" is not supported. Solution: Make ":z!" work and add tests. (Dominique Pellé, closes vim/vim#8836) Use display height instead of current window height. https://github.com/vim/vim/commit/7f2dd1e90c1d4a30c791fae20014594641769a1e
| * | vim-patch:8.2.3398: html text objects are not fully testedSean Dewar2021-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Html text objects are not fully tested. Solution: Add tests for dbcs encoding and different number of backslashes. (Dominique Pellé, closes vim/vim#8831) https://github.com/vim/vim/commit/af631f61bc42d0dddafe1bc0c06872cf3aaeb239 Cherry-pick Test_textobj_quote() and modeline from v8.2.0655.
| * | vim-patch:8.2.3386: using uninitialized memorySean Dewar2021-09-10
| | | | | | | | | | | | | | | | | | Problem: Using uninitialized memory. Solution: Initialize the rm_ic field. (Dominique Pellé, closes vim/vim#8800) https://github.com/vim/vim/commit/a91871262670f9d3a4e5d1c5c6dbc02f85625f7d
| * | vim-patch:8.2.3384: cannot disable modeline for an individual fileSean Dewar2021-09-10
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot disable modeline for an individual file. Solution: Recognize "nomodeline" in a modeline. (Hu Jialun, closes vim/vim#8798) https://github.com/vim/vim/commit/9dcd349ca85e1df1abd1cbf1c29c0f1574b70bf8 Cherry-pick missing modeline for test_modeline.vim (heh) from v8.2.1432.
| * | 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 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.
| * | | 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.
| * | | | 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.
| * | | | feat(f_msgpackdump): support dumping to BlobSean Dewar2021-09-16
| | | | |
| * | | | feat(f_chansend): support Blob data argumentSean Dewar2021-09-16
| | | | |