aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua9
-rw-r--r--runtime/lua/vim/lsp/client.lua4
2 files changed, 7 insertions, 6 deletions
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index da251f89ad..caddd4dde2 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -8800,7 +8800,8 @@ function vim.fn.sinh(expr) end
--- Similar to using a |slice| "expr[start : end]", but "end" is
--- used exclusive. And for a string the indexes are used as
--- character indexes instead of byte indexes.
---- Also, composing characters are not counted.
+--- Also, composing characters are treated as a part of the
+--- preceding base character.
--- When {end} is omitted the slice continues to the last item.
--- When {end} is -1 the last item is omitted.
--- Returns an empty value if {start} or {end} are invalid.
@@ -9208,8 +9209,8 @@ function vim.fn.strcharlen(string) end
--- of byte index and length.
--- When {skipcc} is omitted or zero, composing characters are
--- counted separately.
---- When {skipcc} set to 1, Composing characters are ignored,
---- similar to |slice()|.
+--- When {skipcc} set to 1, composing characters are treated as a
+--- part of the preceding base character, similar to |slice()|.
--- When a character index is used where a character does not
--- exist it is omitted and counted as one character. For
--- example: >vim
@@ -9229,7 +9230,7 @@ function vim.fn.strcharpart(src, start, len, skipcc) end
--- in String {string}.
--- When {skipcc} is omitted or zero, composing characters are
--- counted separately.
---- When {skipcc} set to 1, Composing characters are ignored.
+--- When {skipcc} set to 1, composing characters are ignored.
--- |strcharlen()| always does this.
---
--- Returns zero on error.
diff --git a/runtime/lua/vim/lsp/client.lua b/runtime/lua/vim/lsp/client.lua
index d48be131f3..b06fab7319 100644
--- a/runtime/lua/vim/lsp/client.lua
+++ b/runtime/lua/vim/lsp/client.lua
@@ -693,7 +693,7 @@ function Client:_request(method, params, handler, bufnr)
local request = { type = 'pending', bufnr = bufnr, method = method }
self.requests[request_id] = request
api.nvim_exec_autocmds('LspRequest', {
- buffer = bufnr,
+ buffer = api.nvim_buf_is_valid(bufnr) and bufnr or nil,
modeline = false,
data = { client_id = self.id, request_id = request_id, request = request },
})
@@ -804,7 +804,7 @@ function Client:_cancel_request(id)
if request and request.type == 'pending' then
request.type = 'cancel'
api.nvim_exec_autocmds('LspRequest', {
- buffer = request.bufnr,
+ buffer = api.nvim_buf_is_valid(request.bufnr) and request.bufnr or nil,
modeline = false,
data = { client_id = self.id, request_id = id, request = request },
})