mirror of
https://github.com/neovim/neovim.git
synced 2026-03-23 17:10:52 +00:00
refactor(api): nvim_win_xx_ns are EXPERIMENTAL
Problem:
The nvim_win_xx_ns function family introduced in ba0370b1d7
needs more bake-time. Currently it's narrowly defined for windows, but
other scopes ("buffer") and features are likely in the future.
Solution:
- Rename the API with double-underscore to mark it as EXPERIMENTAL.
TODO/FUTURE:
- Rename and change the signature to support more than just "window"
scope, and for other flexibility.
- Open question: we could choose either:
- "store scopes on namespaces", or
- "store namespaces on scopes (w:/b:/…)"
This commit is contained in:
@@ -129,7 +129,7 @@ function M.on_yank(opts)
|
||||
yank_cancel()
|
||||
end
|
||||
|
||||
vim.api.nvim_win_add_ns(winid, yank_ns)
|
||||
vim.api.nvim__win_add_ns(winid, yank_ns)
|
||||
M.range(bufnr, yank_ns, higroup, "'[", "']", {
|
||||
regtype = event.regtype,
|
||||
inclusive = event.inclusive,
|
||||
@@ -141,7 +141,7 @@ function M.on_yank(opts)
|
||||
yank_timer = nil
|
||||
yank_cancel = nil
|
||||
pcall(vim.api.nvim_buf_clear_namespace, bufnr, yank_ns, 0, -1)
|
||||
pcall(vim.api.nvim_win_del_ns, winid, yank_ns)
|
||||
pcall(vim.api.nvim__win_del_ns, winid, yank_ns)
|
||||
end
|
||||
|
||||
yank_timer = vim.defer_fn(yank_cancel, timeout)
|
||||
|
||||
Reference in New Issue
Block a user