diff options
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/api.txt | 12 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 46 | ||||
-rw-r--r-- | runtime/doc/news.txt | 9 | ||||
-rw-r--r-- | runtime/doc/treesitter.txt | 161 | ||||
-rw-r--r-- | runtime/doc/ui.txt | 4 |
5 files changed, 164 insertions, 68 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index b5a49f6002..f37d349fd8 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -2594,8 +2594,8 @@ nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {*opts}) *nvim_buf_get_extmarks()* nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {*opts}) - Gets |extmarks| (including |signs|) in "traversal order" from a |charwise| - region defined by buffer positions (inclusive, 0-indexed |api-indexing|). + Gets |extmarks| in "traversal order" from a |charwise| region defined by + buffer positions (inclusive, 0-indexed |api-indexing|). Region can be given as (row,col) tuples, or valid extmark ids (whose positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) @@ -2611,6 +2611,10 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {*opts}) the `overlap` option might be useful. Otherwise only the start position of an extmark will be considered. + Note: legacy signs placed through the |:sign| commands are implemented as + extmarks and will show up here. Their details array will contain a + `sign_name` field. + Example: >lua local api = vim.api local pos = api.nvim_win_get_cursor(0) @@ -2742,7 +2746,9 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts}) text around the mark was deleted and then restored by undo. Defaults to true. • invalidate : boolean that indicates whether to hide the - extmark if the entirety of its range is deleted. If + extmark if the entirety of its range is deleted. For + hidden marks, an "invalid" key is added to the "details" + array of |nvim_buf_get_extmarks()| and family. If "undo_restore" is false, the extmark is deleted instead. • priority: a priority value for the highlight group or sign attribute. For example treesitter highlighting uses a diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 24474255ba..433a9fc266 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -3576,8 +3576,8 @@ vim.version.cmp({v1}, {v2}) *vim.version.cmp()* otherwise-equivalent versions. Parameters: ~ - • {v1} (`Version|number[]`) Version object. - • {v2} (`Version|number[]`) Version to compare with `v1` . + • {v1} (`Version|number[]|string`) Version object. + • {v2} (`Version|number[]|string`) Version to compare with `v1` . Return: ~ (`integer`) -1 if `v1 < v2`, 0 if `v1 == v2`, 1 if `v1 > v2`. @@ -3587,8 +3587,18 @@ vim.version.eq({v1}, {v2}) *vim.version.eq()* usage. Parameters: ~ - • {v1} (`Version|number[]`) - • {v2} (`Version|number[]`) + • {v1} (`Version|number[]|string`) + • {v2} (`Version|number[]|string`) + + Return: ~ + (`boolean`) + +vim.version.ge({v1}, {v2}) *vim.version.ge()* + Returns `true` if `v1 >= v2` . See |vim.version.cmp()| for usage. + + Parameters: ~ + • {v1} (`Version|number[]|string`) + • {v2} (`Version|number[]|string`) Return: ~ (`boolean`) @@ -3597,8 +3607,8 @@ vim.version.gt({v1}, {v2}) *vim.version.gt()* Returns `true` if `v1 > v2` . See |vim.version.cmp()| for usage. Parameters: ~ - • {v1} (`Version|number[]`) - • {v2} (`Version|number[]`) + • {v1} (`Version|number[]|string`) + • {v2} (`Version|number[]|string`) Return: ~ (`boolean`) @@ -3612,12 +3622,22 @@ vim.version.last({versions}) *vim.version.last()* Return: ~ (`Version?`) +vim.version.le({v1}, {v2}) *vim.version.le()* + Returns `true` if `v1 <= v2` . See |vim.version.cmp()| for usage. + + Parameters: ~ + • {v1} (`Version|number[]|string`) + • {v2} (`Version|number[]|string`) + + Return: ~ + (`boolean`) + vim.version.lt({v1}, {v2}) *vim.version.lt()* Returns `true` if `v1 < v2` . See |vim.version.cmp()| for usage. Parameters: ~ - • {v1} (`Version|number[]`) - • {v2} (`Version|number[]`) + • {v1} (`Version|number[]|string`) + • {v2} (`Version|number[]|string`) Return: ~ (`boolean`) @@ -3638,7 +3658,8 @@ vim.version.parse({version}, {opts}) *vim.version.parse()* "1.0", "0-x", "tmux 3.2a" into valid versions. Return: ~ - (`table?`) parsed_version Version object or `nil` if input is invalid. + (`Version?`) parsed_version Version object or `nil` if input is + invalid. See also: ~ • # https://semver.org/spec/v2.0.0.html @@ -3662,9 +3683,10 @@ vim.version.range({spec}) *vim.version.range()* print(r:has(vim.version())) -- check against current Nvim version < - Or use cmp(), eq(), lt(), and gt() to compare `.to` and `.from` directly: >lua - local r = vim.version.range('1.0.0 - 2.0.0') - print(vim.version.gt({1,0,3}, r.from) and vim.version.lt({1,0,3}, r.to)) + Or use cmp(), le(), lt(), ge(), gt(), and/or eq() to compare a version + against `.to` and `.from` directly: >lua + local r = vim.version.range('1.0.0 - 2.0.0') -- >=1.0, <2.0 + print(vim.version.ge({1,0,3}, r.from) and vim.version.lt({1,0,3}, r.to)) < Parameters: ~ diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index bc7619ad82..9ef9132c65 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -112,6 +112,11 @@ The following changes may require adaptations in user config or plugins. • '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|. + + ============================================================================== BREAKING CHANGES IN HEAD *news-breaking-dev* @@ -161,7 +166,7 @@ The following new APIs and features were added. • |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| @@ -291,6 +296,8 @@ The following new APIs and features were added. • Terminal buffers respond to OSC background and foreground requests. |default-autocmds| +• |vim.version.le()| and |vim.version.ge()| are added to |vim.version|. + ============================================================================== CHANGED FEATURES *news-changed* diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 14dedbcbd9..d082aa8cc4 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -400,58 +400,115 @@ instance, to highlight comments differently per language: >vim hi @comment.lua guifg=DarkBlue hi link @comment.doc.java String < -The following captures are linked by default to standard |group-name|s: - -@text.literal Comment -@text.reference Identifier -@text.title Title -@text.uri Underlined -@text.underline Underlined -@text.todo Todo - -@comment Comment -@punctuation Delimiter - -@constant Constant -@constant.builtin Special -@constant.macro Define -@define Define -@macro Macro -@string String -@string.escape SpecialChar -@string.special SpecialChar -@character Character -@character.special SpecialChar -@number Number -@boolean Boolean -@float Float - -@function Function -@function.builtin Special -@function.macro Macro -@parameter Identifier -@method Function -@field Identifier -@property Identifier -@constructor Special - -@conditional Conditional -@repeat Repeat -@label Label -@operator Operator -@keyword Keyword -@exception Exception - -@variable Identifier -@type Type -@type.definition Typedef -@storageclass StorageClass -@structure Structure -@namespace Identifier -@include Include -@preproc PreProc -@debug Debug -@tag Tag +The following captures are linked by default to standard |group-name|s (use +|:Inspect| on a group to see the current link): + +@variable various variable names +@variable.builtin built-in variable names (e.g. `this`) +@variable.parameter parameters of a function +@variable.member object and struct fields + +@constant constant identifiers +@constant.builtin built-in constant values +@constant.macro constants defined by the preprocessor + +@module modules or namespaces +@module.builtin built-in modules or namespaces +@label GOTO and other labels (e.g. `label:` in C), including heredoc labels + +@string string literals +@string.documentation string documenting code (e.g. Python docstrings) +@string.regexp regular expressions +@string.escape escape sequences +@string.special other special strings (e.g. dates) +@string.special.symbol symbols or atoms +@string.special.path filenames +@string.special.url URIs (e.g. hyperlinks) + +@character character literals +@character.special special characters (e.g. wildcards) + +@boolean boolean literals +@number numeric literals +@number.float floating-point number literals + +@type type or class definitions and annotations +@type.builtin built-in types +@type.definition identifiers in type definitions (e.g. `typedef <type> <identifier>` in C) +@type.qualifier type qualifiers (e.g. `const`) + +@attribute attribute annotations (e.g. Python decorators) +@property the key in key/value pairs + +@function function definitions +@function.builtin built-in functions +@function.call function calls +@function.macro preprocessor macros + +@function.method method definitions +@function.method.call method calls + +@constructor constructor calls and definitions +@operator symbolic operators (e.g. `+` / `*`) + +@keyword keywords not fitting into specific categories +@keyword.coroutine keywords related to coroutines (e.g. `go` in Go, `async/await` in Python) +@keyword.function keywords that define a function (e.g. `func` in Go, `def` in Python) +@keyword.operator operators that are English words (e.g. `and` / `or`) +@keyword.import keywords for including modules (e.g. `import` / `from` in Python) +@keyword.storage modifiers that affect storage in memory or life-time +@keyword.repeat keywords related to loops (e.g. `for` / `while`) +@keyword.return keywords like `return` and `yield` +@keyword.debug keywords related to debugging +@keyword.exception keywords related to exceptions (e.g. `throw` / `catch`) + +@keyword.conditional keywords related to conditionals (e.g. `if` / `else`) +@keyword.conditional.ternary ternary operator (e.g. `?` / `:`) + +@keyword.directive various preprocessor directives and shebangs +@keyword.directive.define preprocessor definition directives + +@punctuation.delimiter delimiters (e.g. `;` / `.` / `,`) +@punctuation.bracket brackets (e.g. `()` / `{}` / `[]`) +@punctuation.special special symbols (e.g. `{}` in string interpolation) + +@comment line and block comments +@comment.documentation comments documenting code + +@comment.error error-type comments (e.g. `ERROR`, `FIXME`, `DEPRECATED:`) +@comment.warning warning-type comments (e.g. `WARNING:`, `FIX:`, `HACK:`) +@comment.todo todo-type comments (e.g. `TODO:`, `WIP:`, `FIXME:`) +@comment.note note-type comments (e.g. `NOTE:`, `INFO:`, `XXX`) + +@markup.strong bold text +@markup.italic italic text +@markup.strikethrough struck-through text +@markup.underline underlined text (only for literal underline markup!) + +@markup.heading headings, titles (including markers) + +@markup.quote block quotes +@markup.math math environments (e.g. `$ ... $` in LaTeX) +@markup.environment environments (e.g. in LaTeX) + +@markup.link text references, footnotes, citations, etc. +@markup.link.label link, reference descriptions +@markup.link.url URL-style links + +@markup.raw literal or verbatim text (e.g. inline code) +@markup.raw.block literal or verbatim text as a stand-alone block + +@markup.list list markers +@markup.list.checked checked todo-style list markers +@markup.list.unchecked unchecked todo-style list markers + +@diff.plus added text (for diff files) +@diff.minus deleted text (for diff files) +@diff.delta changed text (for diff files) + +@tag XML-style tag names (e.g. in XML, HTML, etc.) +@tag.attribute XML-style tag attributes +@tag.delimiter XML-style tag delimiters *treesitter-highlight-spell* The special `@spell` capture can be used to indicate that a node should be diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 8546478935..c81420d1f2 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -228,6 +228,10 @@ the editor. however a UI might still use such options when rendering raw text sent from Nvim, like for |ui-cmdline|. +["chdir", path] ~ + The |current-directory| of the embedded Nvim process changed to + `path`. + ["mode_change", mode, mode_idx] ~ Editor mode changed. The `mode` parameter is a string representing the current mode. `mode_idx` is an index into the array emitted in |