File tree Expand file tree Collapse file tree 2 files changed +32
-11
lines changed Expand file tree Collapse file tree 2 files changed +32
-11
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ local M = {}
4
4
function M .unblock_guest (guest_pipe )
5
5
local ok , response_sock = require (" flatten.guest" ).sockconnect (guest_pipe )
6
6
if not ok then
7
- vim .notify (" Failed to connect to guest." , vim .log .levels .WARN , {
8
- title = " Flatten" ,
9
- })
7
+ vim .notify (
8
+ string.format (" Failed to connect to rpc host on '%s'." , guest_pipe ),
9
+ vim .log .levels .WARN ,
10
+ {
11
+ title = " flatten.nvim" ,
12
+ }
13
+ )
10
14
return
11
15
end
12
16
vim .rpcnotify (
@@ -120,6 +124,8 @@ function M.parse_argv(argv)
120
124
return pre_cmds , post_cmds
121
125
end
122
126
127
+ --- @param opts { argv : string[] , response_pipe : string , guest_cwd : string }
128
+ --- @return boolean
123
129
function M .run_commands (opts )
124
130
local argv = opts .argv
125
131
@@ -328,9 +334,15 @@ function M.edit_files(opts)
328
334
end
329
335
bufnr = focus .bufnr
330
336
else
331
- vim .api .nvim_err_writeln (
332
- " Flatten: 'config.open.focus' expects a function or string, got "
333
- .. type (open )
337
+ vim .notify (
338
+ string.format (
339
+ " 'config.open.focus' expects a function or string, got %s" ,
340
+ type (open )
341
+ ),
342
+ vim .log .levels .ERROR ,
343
+ {
344
+ title = " flatten.nvim" ,
345
+ }
334
346
)
335
347
return false
336
348
end
Original file line number Diff line number Diff line change @@ -26,11 +26,20 @@ function M.maybe_block(block)
26
26
vim .cmd .qa ({ bang = true })
27
27
end
28
28
waiting = true
29
- vim .wait (math.huge , function ()
30
- return waiting == false
31
- or vim .api .nvim_get_chan_info (host ) == vim .empty_dict ()
32
- end )
33
- vim .cmd .qa ({ bang = true })
29
+ if
30
+ vim .wait (math.huge , function ()
31
+ return waiting == false
32
+ or vim .api .nvim_get_chan_info (host ) == vim .empty_dict ()
33
+ end , nil , true )
34
+ then
35
+ vim .cmd .qa ({ bang = true })
36
+ else
37
+ vim .notify (
38
+ " Waiting interrupted by user" ,
39
+ vim .log .levels .WARN ,
40
+ { title = " flatten.nvim" }
41
+ )
42
+ end
34
43
end
35
44
36
45
function M .send_files (files , stdin )
You can’t perform that action at this time.
0 commit comments