aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-02-21 21:21:42 +0100
committerGitHub <noreply@github.com>2022-02-21 21:21:42 +0100
commit10a46a20ce78efa80c1d1f7ac43b2a95ef92ea76 (patch)
treee5d0d1386982c5ae6e260bd60449d8449be57538 /runtime/doc
parent1e7cb2dcd975aadeb91b913f117b21c7775c3374 (diff)
downloadrneovim-10a46a20ce78efa80c1d1f7ac43b2a95ef92ea76.tar.gz
rneovim-10a46a20ce78efa80c1d1f7ac43b2a95ef92ea76.tar.bz2
rneovim-10a46a20ce78efa80c1d1f7ac43b2a95ef92ea76.zip
refactor(highlight)!: optional arguments for highlight.range as table (#17462)
also update documentation BREAKING CHANGE: signature of highlight.range is now vim.highlight.range(bufnr, ns, hlgroup, start, finish, { regtype = regtype, inclusive = inclusive, priority = priority }) Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lua.txt32
1 files changed, 26 insertions, 6 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 1a2d845281..355c31090e 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -595,13 +595,33 @@ vim.highlight.on_yank({opts}) *vim.highlight.on_yank()*
- {on_visual} highlight when yanking visual selection (default `true`)
- {event} event structure (default |v:event|)
-vim.highlight.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {rtype}, {inclusive})
+vim.highlight.range({bufnr}, {ns}, {hlgroup}, {start}, {finish}, {opts})
*vim.highlight.range()*
- Highlights the range between {start} and {finish} (tuples of {line,col})
- in buffer {bufnr} with the highlight group {higroup} using the namespace
- {ns}. Optional arguments are the type of range (characterwise, linewise,
- or blockwise, see |setreg|; default to characterwise) and whether the
- range is inclusive (default false).
+
+ Apply highlight group to range of text.
+
+ Parameters: ~
+ {bufnr} buffer number
+ {ns} namespace for highlights
+ {hlgroup} highlight group name
+ {start} starting position (tuple {line,col})
+ {finish} finish position (tuple {line,col})
+ {opts} optional parameters:
+ • `regtype`: type of range (characterwise, linewise,
+ or blockwise, see |setreg|), default `'v'`
+ • `inclusive`: range includes end position, default
+ `false`
+ • `priority`: priority of highlight, default
+ `vim.highlight.user` (see below)
+
+vim.highlight.priorities *vim.highlight.priorities*
+
+ Table with default priorities used for highlighting:
+ • `syntax`: `50`, used for standard syntax highlighting
+ • `treesitter`: `100`, used for tree-sitter-based highlighting
+ • `diagnostics`: `150`, used for code analysis such as diagnostics
+ • `user`: `200`, used for user-triggered highlights such as LSP
+ document symbols or `on_yank` autocommands
------------------------------------------------------------------------------
VIM.REGEX *lua-regex*