mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-21 23:14:54 +01:00
fix: invoke attach callback on main thread
This commit is contained in:
parent
14286f1699
commit
d0d1fb73ae
1 changed files with 120 additions and 117 deletions
|
@ -57,7 +57,9 @@ local function attach(name, opts)
|
|||
|
||||
vim.api.nvim_set_option_value('fileformat', 'unix', { buf = buffer })
|
||||
vim.api.nvim_buf_set_name(buffer, name)
|
||||
|
||||
CODEMP.workspace:attach(name):and_then(function (controller)
|
||||
vim.schedule(function()
|
||||
-- TODO disgusting! but poll blocks forever on empty buffers...
|
||||
if not opts.nowait then
|
||||
local promise = controller:poll()
|
||||
|
@ -189,6 +191,7 @@ local function attach(name, opts)
|
|||
print(" ++ attached to buffer " .. name)
|
||||
require('codemp.window').update()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
---@param buffer? integer if provided, sync given buffer id, otherwise sync current buf
|
||||
|
|
Loading…
Reference in a new issue