1
mirror of https://github.com/neovim/neovim.git synced 2025-01-01 17:23:36 -07:00
neovim/runtime/lua/vim/_meta
zeertzjq d831392b15
feat(paste): unify cancel and error behavior ()
Before this PR, the behavior of nvim_paste is:
- When vim.paste() returns false, return false to the client, but treat
  following chunks normally (i.e. rely on the client cancelling the
  paste as expected).
- When vim.paste() throws an error, still return true to the client, but
  drain the following chunks in the stream without calling vim.paste().

There are two problems with such behavior:
- When vim.paste() errors, the client is still supposed to send the
  remaining chunks of the stream, even though they do nothing.
- Having different code paths for two uncommon but similar situations
  complicates maintenance.

This PR makes both the cancel case and the error case return false to
the client and drain the remaining chunks of the stream, which, apart
from sharing the same code path, is beneficial whether the client checks
the return value of nvim_paste or not:
- If the client checks the return value, it can avoid sending the
  following chunks needlessly after an error.
- If the client doesn't check the return value, chunks following a
  cancelled chunk won't be pasted on the server regardless, which leads
  to less confusing behavior.
2024-09-24 07:14:14 +08:00
..
api_keysets_extra.lua fix(ui): correctly pass metadata to get_node_text 2024-09-01 10:15:02 -07:00
api_keysets.lua feat: get/set namespace properties 2024-06-07 08:33:40 -07:00
api.lua feat(paste): unify cancel and error behavior () 2024-09-24 07:14:14 +08:00
base64.lua fix: lua annotations 2024-04-26 15:13:06 +01:00
builtin_types.lua test(lsp): refactor and tidy 2024-08-11 15:14:14 +01:00
builtin.lua refactor(lua): improve type annotations 2024-06-11 12:45:43 +01:00
diff.lua fix: lua annotations 2024-04-26 15:13:06 +01:00
json.lua feat(docs): replace lua2dox.lua 2024-02-27 14:41:17 +00:00
lpeg.lua docs(lpeg): merge upstream changes 2024-07-15 21:16:29 +01:00
misc.lua fix: type warnings in shared.lua 2024-02-15 11:32:50 +00:00
mpack.lua feat(docs): replace lua2dox.lua 2024-02-27 14:41:17 +00:00
options.lua refactor!: rename 'jumpoptions' flag "unload" to "clean" () 2024-09-19 18:05:27 +08:00
re.lua docs: news 2024-05-15 23:19:26 +02:00
regex.lua docs: improve/add documentation of Lua types 2024-03-01 23:02:18 +00:00
spell.lua refactor(lua): use tuple syntax everywhere 2024-06-04 06:06:02 -07:00
vimfn.lua docs(eval): update param types of prompt-buffer functions () 2024-09-16 18:33:35 +08:00
vvars.lua feat(complete): specify reason for CompleteDone 2024-05-24 11:57:46 +02:00