Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lua/kitty-scrollback/backport/_system.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- NOTE: copied from
-- https://github.com/neovim/neovim/blob/909b18d05a8d472b12c156e1663282bf6f5ce307/runtime/lua/vim/_system.lua
-- https://github.com/neovim/neovim/blob/4369d7d9a7804b8f9c2254da9f153d428115334a/runtime/lua/vim/_system.lua

---@diagnostic disable
local uv = vim.uv
Expand Down Expand Up @@ -140,18 +140,18 @@ function SystemObj:is_closing()
return handle == nil or handle:is_closing() or false
end

--- @param output? uv.read_start.callback|false
--- @param output? fun(err: string?, data: string?)|false
--- @param text? boolean
--- @return uv.uv_stream_t? pipe
--- @return uv.read_start.callback? handler
--- @return fun(err: string?, data: string?)? handler
--- @return string[]? data
local function setup_output(output, text)
if output == false then
return
end

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

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

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

--- @type uv.read_start.callback
--- @param err? string
--- @param data? string
local function handler_with_close(err, data)
handler(err, data)
if data == nil then
Expand Down Expand Up @@ -249,7 +250,7 @@ local function spawn(cmd, opts, on_exit, on_error)
local handle, pid_or_err = uv.spawn(cmd, opts, on_exit)
if not handle then
on_error()
error(pid_or_err)
error(('%s: "%s"'):format(pid_or_err, cmd))
end
return handle, pid_or_err --[[@as integer]]
end
Expand Down
2 changes: 1 addition & 1 deletion lua/kitty-scrollback/backport/backport-sha.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"runtime/lua/vim/_system.lua": "3bbc4a1c066f050fc21d1347ecfc17cda4d4c84b10ab6aa7207da05309861b13",
"runtime/lua/vim/_system.lua": "72a5549adb44633723428e44d76adb5fc9c96c965d1f902ecdac5b159b0a1258",
"runtime/lua/vim/version.lua": "7cd54f46501cd299017084055d6e17025271cf3f637db789d35c83c43a9c6223"
}