File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,14 +6,28 @@ local StopShell = function(channel_id)
66 end
77end
88
9+ -- This is based on https://github.com/Robitx/gp.nvim/commit/5ccf0d28c6fbc206ebd853a9a2f1b1ab9878cdab
10+ local undojoin = function (buf )
11+ if not buf or not vim .api .nvim_buf_is_loaded (buf ) then
12+ return
13+ end
14+ local status , result = pcall (vim .cmd .undojoin )
15+ if not status then
16+ if result :match (" E790" ) then
17+ return
18+ end
19+ M .error (" Error running undojoin: " .. vim .inspect (result ))
20+ end
21+ end
22+
923local StartShell = function (opts )
1024 local command = opts .command
1125 local buf = opts .buf
1226 local follow = opts .follow
1327
1428 local output_prefix = " "
1529 local insert_output = function (bufnr , data )
16- vim . cmd . undojoin ()
30+ undojoin (bufnr )
1731 -- check if bufnr still exists
1832 if vim .api .nvim_buf_is_loaded (bufnr ) == false then
1933 return
You can’t perform that action at this time.
0 commit comments