Co-authored-by: nguyenkd27 <nguyenkd27@gmail.com>
Co-authored-by: dundargoc <gocdundar@gmail.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: Tuure Piitulainen <tuure.piitulainen@gmail.com>
Co-authored-by: Maria Solano <majosolano99@gmail.com>
Co-authored-by: tao <2471314@gmail.com>
This commit is contained in:
Justin M. Keyes
2025-11-16 20:36:07 -08:00
committed by GitHub
parent 6e2b514813
commit c8b6852363
12 changed files with 55 additions and 51 deletions

View File

@@ -2261,8 +2261,10 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
will be `nvim_buf_changedtick_event`. Not for Lua
callbacks.
• {opts} (`vim.api.keyset.buf_attach`) Optional parameters.
• on_lines: Lua callback invoked on change. Return a
truthy value (not `false` or `nil`) to detach. Args:
• on_lines: Called on linewise changes. Not called on
buffer reload (`:checktime`, `:edit`, …), see
`on_reload:`. Return a |lua-truthy| value to detach.
Args:
• the string "lines"
• buffer id
• b:changedtick
@@ -2272,10 +2274,10 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
• byte count of previous contents
• deleted_codepoints (if `utf_sizes` is true)
• deleted_codeunits (if `utf_sizes` is true)
• on_bytes: Lua callback invoked on change. This
callback receives more granular information about the
change compared to on_lines. Return a truthy value
(not `false` or `nil`) to detach. Args:
• on_bytes: Called on granular changes (compared to
on_lines). Not called on buffer reload (`:checktime`,
`:edit`, …), see `on_reload:`. Return a
|lua-truthy| value to detach. Args:
• the string "bytes"
• buffer id
• b:changedtick
@@ -2293,16 +2295,17 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
• new end column of the changed text (if new end row
= 0, offset from start column)
• new end byte length of the changed text
• on_changedtick: Lua callback invoked on changedtick
increment without text change. Args:
• on_changedtick: Called on |changetick| increment
without text change. Args:
• the string "changedtick"
• buffer id
• b:changedtick
• on_detach: Lua callback invoked on detach. Args:
• on_detach: Called on detach. Args:
• the string "detach"
• buffer id
• on_reload: Lua callback invoked on reload. The entire
buffer content should be considered changed. Args:
• on_reload: Called on whole-buffer load (`:checktime`,
`:edit`, …). Clients should typically re-fetch the
entire buffer contents. Args:
• the string "reload"
• buffer id
• utf_sizes: include UTF-32 and UTF-16 size of the
@@ -2312,7 +2315,7 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
Return: ~
(`boolean`) False if attach failed (invalid parameter, or buffer isn't
loaded); otherwise True. TODO: LUA_API_NO_EVAL
loaded); otherwise True.
See also: ~
• |nvim_buf_detach()|

View File

@@ -232,9 +232,8 @@ white space after a word, they only change up to the end of the word. This is
because Vim interprets "cw" as change-word, and a word does not include the
following white space.
If you prefer "cw" to include the space after a word, use this mapping: >
:map cw dwi
Or use "caw" (see |aw|).
If you prefer "cw" to include the space after a word, see |cpo-_| to change
the behavior. Alternatively, use "caw" (see |aw|).
*:c* *:ch* *:change*
:{range}c[hange][!] Replace lines of text with some different text.

View File

@@ -1,4 +1,4 @@
*develop.txt* Nvim
*dev.txt* Nvim
NVIM REFERENCE MANUAL
@@ -365,6 +365,9 @@ Where possible, these patterns apply to _both_ Lua and the API:
filter(function() … end, …, opts)
-- ❌ NO:
filter(…, function() … end, opts)
- Expose a `config(opts)` function if the module accepts user configuration.
If `opts` is omitted (or `nil`) it returns the current configuration.
- Example: See |vim.diagnostic.config()|.
- "Enable" ("toggle") interface and behavior:
- `enable(…, nil)` and `enable(…, {buf=nil})` are synonyms and control the
the "global" enablement of a feature.

View File

@@ -1,4 +1,4 @@
*dev_test* Nvim
*dev_test.txt* Nvim
NVIM REFERENCE MANUAL

View File

@@ -184,6 +184,10 @@ Examples: >lua
-- ba
print(string.match("foo.bar", "%.bar"))
-- .bar
<
*lua-truthy*
Only `false` and `nil` evaluate to "false" in Lua. All other values are "true".
==============================================================================
IMPORTING LUA MODULES *lua-module-load*

View File

@@ -1377,7 +1377,7 @@ paths.
*base-directories* *xdg*
The "base" (root) directories conform to the XDG Base Directory Specification.
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
https://specifications.freedesktop.org/basedir/latest/
The $XDG_CONFIG_HOME, $XDG_DATA_HOME, $XDG_RUNTIME_DIR, $XDG_STATE_HOME,
$XDG_CACHE_HOME, $XDG_CONFIG_DIRS and $XDG_DATA_DIRS environment variables
are used if defined, else default values (listed below) are used.