diff options
Diffstat (limited to 'runtime/doc/news.txt')
-rw-r--r-- | runtime/doc/news.txt | 243 |
1 files changed, 194 insertions, 49 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 825e5ba41f..3029414500 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -15,7 +15,7 @@ BREAKING CHANGES *news-breaking* The following changes may require adaptations in user config or plugins. -• In some cases, the cursor in the Nvim |TUI| would blink even without +• In some cases, the cursor in the Nvim |TUI| used to blink even without configuring 'guicursor' as mentioned in |cursor-blinking|. This was a bug that has now been fixed. If your cursor has stopped blinking, add the following (or similar, adapted to user preference) to your |config| file: >vim @@ -71,9 +71,6 @@ The following changes may require adaptations in user config or plugins. now requires an explicit range argument to be passed. If injections are required, provide an explicit range via `parser:parse({ start_row, end_row })`. -• Float window support hide and show by setting `hide` on `nvim_open_win` and - `nvim_win_set_config`. - • |vim.lsp.util.parse_snippet()| will now strictly follow the snippet grammar defined by LSP, and hence previously parsed snippets might now be considered invalid input. @@ -95,14 +92,59 @@ The following changes may require adaptations in user config or plugins. • Legacy and extmark signs are displayed and listed with the same priority: line number -> priority -> sign id -> recently placed +• Default color scheme has been updated to be "Nvim branded" and accessible. + Use `:colorscheme vim` to revert to the old legacy color scheme. + + Here is a list of Nvim specific highlight groups which are now defined in + a meaningfully different way and might need an update: + • |hl-FloatBorder| is linked to |hl-NormalFloat| instead of |hl-WinSeparator|. + • |hl-NormalFloat| is not linked to |hl-Pmenu|. + • |hl-WinBar| has different background. + • |hl-WinBarNC| is similar to |hl-WinBar| but not bold. + • |hl-WinSeparator| is linked to |hl-Normal| instead of |hl-VertSplit|. + + This also might result into some color schemes looking differently due to + them relying on implicit assumptions about how highlight groups are defined + by default. To account for this, define all attributes of highlight groups + explicitly. Alternatively, use `:colorscheme vim` or `:source + $VIMRUNTIME/colors/vim.lua` to restore previous definitions. + +• 'termguicolors' is enabled by default when Nvim is able to determine that + the host terminal emulator supports 24-bit color. + +• Treesitter highlight groups have been renamed to be more in line with + upstream tree-sitter and Helix to make it easier to share queries. The full + list is documented in |treesitter-highlight-groups|. + +• |vim.lsp.codelens.refresh()| now takes an `opts` argument. With this change, + the default behavior of just refreshing the current buffer has been replaced by + refreshing all buffers. + +• |shm-q| now fully hides macro recording message instead of only shortening it. + +• Returning any truthy value from a callback passed to |nvim_create_autocmd()| + (rather than just `true`) will delete the autocommand. + +• |vim.lsp.util.extract_completion_items()| will no longer return reliable + results, since it does not apply `itemDefaults` when its input is a + `CompletionList`. + Moreover, since support for LSP `completionList.itemDefaults` was added, + some third party plugins might be negatively impacted in case the language + servers support the feature but the plugin does not. + If necessary, the respective capability can be + removed when calling |vim.lsp.protocol.make_client_capabilities()|. + +• |:TOhtml| has been rewritten in Lua to support Neovim-specific decorations, + and many options have been removed. + ============================================================================== BREAKING CHANGES IN HEAD *news-breaking-dev* The following breaking changes were made during the development cycle to unreleased features on Nvim HEAD. -• ... -• ... +• Removed `vim.treesitter.foldtext` as transparent foldtext is now supported + https://github.com/neovim/neovim/pull/20750 ============================================================================== NEW FEATURES *news-features* @@ -115,31 +157,39 @@ The following new APIs and features were added. • Treesitter highlighting now parses injections incrementally during screen redraws only for the line range being rendered. This significantly improves performance in large files with many injections. + • 'breakindent' performance is significantly improved for wrapped lines. + • Cursor movement, insertion with [count] and |screenpos()| are now faster. • |vim.iter()| provides a generic iterator interface for tables and Lua iterators |for-in|. -• Added |vim.ringbuf()| to create ring buffers. +• |vim.ringbuf()| creates ring buffers. -• Added |vim.keycode()| for translating keycodes in a string. +• |vim.keycode()| translates keycodes in a string. • |'smoothscroll'| option to scroll by screen line rather than by text line when |'wrap'| is set. -• Added inline virtual text support to |nvim_buf_set_extmark()|. +• |nvim_buf_set_extmark()| supports inline virtual text. • 'foldtext' now supports virtual text format. |fold-foldtext| +• |'foldtext'| can be set to an empty string to disable and render the line: + as normal with regular highlighting and no line wrapping. + • The terminal buffer now supports reflow (wrapped lines adapt when the buffer is resized horizontally). Note: Lines that are not visible and kept in |'scrollback'| are not reflown. • |vim.system()| for running system commands. -• Added |nvim_win_text_height()| to compute the number of screen lines occupied +• |vim.lpeg| and |vim.re| expose the bundled Lpeg expression grammar parser + and its regex interface. + +• |nvim_win_text_height()| computes the number of screen lines occupied by a range of text in a given window. -• |nvim_set_keymap()| and |nvim_del_keymap()| now support abbreviations. +• Mapping APIs now support abbreviations when mode short-name has suffix "a". • Better cmdline completion for string option value. |complete-set-option| @@ -158,7 +208,7 @@ The following new APIs and features were added. https://microsoft.github.io/language-server-protocol/specification/#textDocument_inlayHint • Implemented pull diagnostic textDocument/diagnostic: |vim.lsp.diagnostic.on_diagnostic()| https://microsoft.github.io/language-server-protocol/specification/#textDocument_diagnostic - • Added |vim.lsp.status()| to consume the last progress messages as a string. + • |vim.lsp.status()| consumes the last progress messages as a string. • LSP client now always saves and restores named buffer marks when applying text edits. • LSP client now supports the `positionEncoding` server capability. If a server @@ -169,26 +219,39 @@ The following new APIs and features were added. indicator to see if a server supports a feature. Instead use `client.supports_method(<method>)`. It considers both the dynamic capabilities and static `server_capabilities`. - • Added a new `anchor_bias` option to |lsp-handlers| to aid in positioning of - floating windows. + • `anchor_bias` option to |lsp-handlers| aids in positioning of floating + windows. + • |vim.lsp.util.locations_to_items()| sets the `user_data` of each item to + the original LSP `Location` or `LocationLink`. + • Added support for connecting to servers using named pipes (Windows) or + unix domain sockets (Unix) via |vim.lsp.rpc.domain_socket_connect()|. + • Added support for `completionList.itemDefaults`, reducing overhead when + computing completion items where properties often share the same value + (e.g. `commitCharacters`). Note that this might affect plugins and + language servers that don't support the feature, and in such cases the + respective capability can be unset. • Treesitter • Bundled parsers and queries (highlight, folds) for Markdown, Python, and Bash. - • Added |vim.treesitter.query.omnifunc()| for treesitter query files (set by + • |vim.treesitter.query.omnifunc()| for treesitter query files (set by default). • |Query:iter_matches()| now has the ability to set the maximum start depth for matches. - • `@injection.language` now has smarter resolution and will now fallback to language aliases and/or attempt lower case variants of the text. - language via aliases (e.g., filetype) registered via - `vim.treesitter.language.register`. - • The `#set!` directive now supports `injection.self` and `injection.parent` for injecting either the current node's language - or the parent LanguageTree's language, respectively. - • Added `vim.treesitter.query.edit()`, for live editing of treesitter + • `@injection.language` now has smarter resolution and will fall back to + language aliases (e.g., filetype or custom shorthands) registered via + |vim.treesitter.language.register()| and/or attempt lower case variants of + the text. + • The `#set!` directive now supports `injection.self` and `injection.parent` + for injecting either the current node's language or the parent + |LanguageTree|'s language, respectively. + • |vim.treesitter.query.edit()| allows live editing of treesitter queries. • Improved error messages for query parsing. - • Added |vim.treesitter.foldtext()| to apply treesitter highlighting to - foldtext. + • |:InspectTree| shows node ranges in 0-based indexing instead of 1-based + indexing. + • |:InspectTree| shows root nodes + • |:InspectTree| now supports |folding| • |vim.ui.open()| opens URIs using the system default handler (macOS `open`, Windows `explorer`, Linux `xdg-open`, etc.) @@ -200,34 +263,35 @@ The following new APIs and features were added. • `vim.*` • `vim.fn.*` • `vim.api.*` + • `vim.v.*` • Improved messages for type errors in `vim.api.*` calls (including `opts` params) • Functions that take a severity as an optional parameter (e.g. |vim.diagnostic.get()|) now also accept a list of severities |vim.diagnostic.severity| -• New RPC client type `msgpack-rpc` is added for `nvim_set_client_info` to +• New RPC client type `msgpack-rpc` is added for |nvim_set_client_info()| to support fully MessagePack-RPC compliant clients. • Floating windows can now show footer with new `footer` and `footer_pos` config fields. Uses |hl-FloatFooter| by default. -• The |:terminal| command now accepts some |:command-modifiers| (specifically - |:horizontal| and those that affect splitting a window). +• Floating windows can now be hidden by setting `hide` in |nvim_open_win()| or + |nvim_win_set_config()|. -• |vim.lsp.util.locations_to_items()| sets the `user_data` of each item to the - original LSP `Location` or `LocationLink`. +• |:terminal| command now accepts some |:command-modifiers| (specifically + |:horizontal| and those that affect splitting a window). • |$NVIM_APPNAME| can be set to a relative path instead of only a name. -• Added |:fclose| command. +• |:fclose| command. -• Added |vim.snippet| for snippet expansion support. +• |vim.snippet| handles expansion of snippets in LSP format. • 'complete' option supports "f" flag for completing buffer names. -• Added |vim.base64.encode()| and |vim.base64.decode()| for encoding and decoding - strings using Base64 encoding. +• |vim.base64.encode()| and |vim.base64.decode()| encode and decode strings + using Base64 encoding. • The |TermResponse| autocommand event can be used with |v:termresponse| to read escape sequence responses from the terminal. @@ -236,11 +300,45 @@ The following new APIs and features were added. clipboard is now bundled by default and will be automatically enabled under certain conditions. |clipboard-osc52| -• The 'termsync' option asks the terminal emulator to buffer screen updates - until the redraw cycle is complete. Requires support from the terminal. +• 'termsync' option asks the terminal emulator to buffer screen updates until + the redraw cycle is complete. Requires support from the terminal. + +• |vim.text.hexencode()| and |vim.text.hexdecode()| convert strings to and + from byte representations. + +• 'completeopt' option supports "popup" flag to show extra information in a + floating window. + +• |nvim_input_mouse()| supports mouse buttons "x1" and "x2". + +• |v_Q-default| and |v_@-default| repeat a register for each line of a visual + selection. + +• |vim.diagnostic.count()| returns the number of diagnostics for a given + buffer and/or namespace, by severity. This is a faster alternative to + |vim.diagnostic.get()| when only the number of diagnostics is needed, but + not the diagnostics themselves. + +• |vim.deepcopy()| has a `noref` argument to avoid hashing table values. + +• Terminal buffers emit a |TermRequest| autocommand event when the child + process emits an OSC or DCS control sequence. -• Added |vim.text.hexencode()| and |vim.text.hexdecode()| to convert strings - to and from byte representations. +• Terminal buffers respond to OSC background and foreground requests. |default-autocmds| + +• |vim.version.le()| and |vim.version.ge()| are added to |vim.version|. + +• |extmarks| can be associated with a URL and URLs are included as a new + highlight attribute. The TUI will display URLs using the OSC 8 control + sequence, enabling clickable text in supporting terminals. + +• Added |nvim_tabpage_set_win()| to set the current window of a tabpage. + +• Clicking on a tabpage in the tabline with the middle mouse button closes it. + +• |namespace| can now have window scopes. |nvim_win_add_ns()| + +• |extmarks| option `scoped`: only show the extmarks in its namespace's scope. ============================================================================== CHANGED FEATURES *news-changed* @@ -253,7 +351,7 @@ The following changes to existing APIs or features add new behavior. • |vim.region()| can use a string accepted by |getpos()| as position. -• vim.diagnostic.config() now accepts a function for the virtual_text.prefix +• |vim.diagnostic.config()| now accepts a function for the virtual_text.prefix option, which allows for rendering e.g., diagnostic severities differently. • Defaults: @@ -266,16 +364,24 @@ The following changes to existing APIs or features add new behavior. vim.g.query_lint_on = {} < • Enabled treesitter highlighting for treesitter query files. + • Enabled treesitter highlighting for help files. + • Enabled treesitter highlighting for Lua files. • The `workspace/didChangeWatchedFiles` LSP client capability is now enabled by default. + • On Mac or Windows, `libuv.fs_watch` is used as the backend. + • On Linux, `fswatch` (recommended) is used as the backend if available, + otherwise `libuv.fs_event` is used on each subdirectory. • |LspRequest| autocmd callbacks now contain additional information about the LSP request status update that occurred. -• `:source` without arguments treats a buffer with its 'filetype' set to "lua" +• |:source| without arguments treats a buffer with its 'filetype' set to "lua" as Lua code regardless of its extension. +• |:lua| with a |[range]| executes that range in the current buffer as Lua code + regardless of its extension. + • |:checkhealth| buffer now implements |folding|. The initial folding status is defined by the 'foldenable' option. @@ -283,6 +389,7 @@ The following changes to existing APIs or features add new behavior. • |gx| now uses |vim.ui.open()| and not netrw. To customize, you can redefine `vim.ui.open` or remap `gx`. To continue using netrw (deprecated): >vim + :call netrw#BrowseX(expand(exists("g:netrw_gx")? g:netrw_gx : '<cfile>'), netrw#CheckIfRemote())<CR> • |vim.lsp.start()| now maps |K| to use |vim.lsp.buf.hover()| if the server @@ -307,11 +414,10 @@ The following changes to existing APIs or features add new behavior. In addition, |nvim_buf_get_extmarks()| has gained an "overlap" option to return such ranges even if they started before the specified position. -• Extmarks can opt-out of precise undo tracking using the new "undo_restore" - flag to |nvim_buf_set_extmark()| - -• Extmarks can be automatically hidden or removed using the new "invalidate" - flag to |nvim_buf_set_extmark()| +• The following flags were added to |nvim_buf_set_extmark()|: + - "undo_restore": opt-out extmarks of precise undo tracking. + - "invalidate": automatically hide or delete extmarks. + - "virt_text_repeat_linebreak": repeat virtual text on wrapped lines. • LSP hover and signature help now use Treesitter for highlighting of Markdown content. @@ -327,17 +433,50 @@ The following changes to existing APIs or features add new behavior. • |vim.wait()| is no longer allowed to be called in |api-fast|. +• Vimscript function |exists()| supports checking |v:lua| functions. + +• Added "force_crlf" option field in |nvim_open_term()|. + +• Attempting to set an invalid keycode option (e.g. `set t_foo=123`) no longer + gives an error. + +• Passing 0 to |nvim_get_chan_info()| gets info about the current channel. + +• |:checkhealth| buffer can now be opened in a split window using modifiers like + |:vertical|, |:horizontal| and |:botright|. + +• |nvim_open_win()| and |nvim_win_set_config()| now support opening normal (split) + windows, and moving floating windows into split windows. + +• 'errorfile' (|-q|) accepts `-` as an alias for stdin. + +• |--startuptime| reports the startup times for both processes (TUI + server) as separate sections. + +• |nvim_buf_call()| and |nvim_win_call()| now preserves any return value (NB: not multiple return values) + +• Treesitter + • |Query:iter_matches()|, |vim.treesitter.query.add_predicate()|, and + |vim.treesitter.query.add_directive()| accept a new `all` option which + ensures that all matching nodes are returned as a table. The default option + `all=false` returns only a single node, breaking captures with quantifiers + like `(comment)+ @comment; it is only provided for backward compatibility + and will be removed after Nvim 0.10. + • |vim.treesitter.query.add_predicate()| and + |vim.treesitter.query.add_directive()| now accept an options table rather + than a boolean "force" argument. To force a predicate or directive to + override an existing predicate or directive, use `{ force = true }`. + ============================================================================== REMOVED FEATURES *news-removed* The following deprecated functions or APIs were removed. -• Vimball support is removed. - - :Vimuntar command removed. +• Vimball support + - :Vimuntar command -• Support for legacy treesitter injection queries is removed. +• Support for legacy treesitter injection queries -• Removed 'shortmess' flags: +• 'shortmess' flags: - |shm-f|. Always uses "(3 of 5)", never "(file 3 of 5)" - |shm-i|. Always use "[noeol]". - |shm-x|. Always use "[dos]", "[unix]" and "[mac]" @@ -349,6 +488,9 @@ DEPRECATIONS *news-deprecations* The following functions are now deprecated and will be removed in a future release. +• Configuring |diagnostic-signs| using |:sign-define| or |sign_define()|. Use + the "signs" key of |vim.diagnostic.config()| instead. + • Checkhealth functions: - |health#report_error|, |vim.health.report_error()| Use |vim.health.error()| instead. - |health#report_info|, |vim.health.report_info()| Use |vim.health.info()| instead. @@ -375,13 +517,16 @@ release. - |vim.lsp.util.parse_snippet()| - |vim.lsp.util.text_document_completion_list_to_complete_items()| -• `vim.loop` has been renamed to `vim.uv`. +• `vim.loop` has been renamed to |vim.uv|. -• vim.treesitter.languagetree functions: +• vim.treesitter functions: - |LanguageTree:for_each_child()| Use |LanguageTree:children()| (non-recursive) instead. • The "term_background" UI option |ui-ext-options| is deprecated and no longer populated. Background color detection is now performed in Lua by the Nvim core, not the TUI. +• vim.shared functions: + - |vim.tbl_add_reverse_lookup()| + vim:tw=78:ts=8:sw=2:et:ft=help:norl: |