Skip to content

Commit 67431bd

Browse files
authored
chore: latest backport changes (#332)
1 parent 6c24f19 commit 67431bd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lua/kitty-scrollback/backport/_system.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- NOTE: copied from
2-
-- https://github.com/neovim/neovim/blob/909b18d05a8d472b12c156e1663282bf6f5ce307/runtime/lua/vim/_system.lua
2+
-- https://github.com/neovim/neovim/blob/4369d7d9a7804b8f9c2254da9f153d428115334a/runtime/lua/vim/_system.lua
33

44
---@diagnostic disable
55
local uv = vim.uv
@@ -140,18 +140,18 @@ function SystemObj:is_closing()
140140
return handle == nil or handle:is_closing() or false
141141
end
142142

143-
--- @param output? uv.read_start.callback|false
143+
--- @param output? fun(err: string?, data: string?)|false
144144
--- @param text? boolean
145145
--- @return uv.uv_stream_t? pipe
146-
--- @return uv.read_start.callback? handler
146+
--- @return fun(err: string?, data: string?)? handler
147147
--- @return string[]? data
148148
local function setup_output(output, text)
149149
if output == false then
150150
return
151151
end
152152

153153
local bucket --- @type string[]?
154-
local handler --- @type uv.read_start.callback
154+
local handler --- @type fun(err: string?, data: string?)
155155

156156
if type(output) == 'function' then
157157
handler = output
@@ -171,7 +171,8 @@ local function setup_output(output, text)
171171

172172
local pipe = assert(uv.new_pipe(false))
173173

174-
--- @type uv.read_start.callback
174+
--- @param err? string
175+
--- @param data? string
175176
local function handler_with_close(err, data)
176177
handler(err, data)
177178
if data == nil then
@@ -249,7 +250,7 @@ local function spawn(cmd, opts, on_exit, on_error)
249250
local handle, pid_or_err = uv.spawn(cmd, opts, on_exit)
250251
if not handle then
251252
on_error()
252-
error(pid_or_err)
253+
error(('%s: "%s"'):format(pid_or_err, cmd))
253254
end
254255
return handle, pid_or_err --[[@as integer]]
255256
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"runtime/lua/vim/_system.lua": "3bbc4a1c066f050fc21d1347ecfc17cda4d4c84b10ab6aa7207da05309861b13",
2+
"runtime/lua/vim/_system.lua": "72a5549adb44633723428e44d76adb5fc9c96c965d1f902ecdac5b159b0a1258",
33
"runtime/lua/vim/version.lua": "7cd54f46501cd299017084055d6e17025271cf3f637db789d35c83c43a9c6223"
44
}

0 commit comments

Comments
 (0)