mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-21 23:14:54 +01:00
fix: set buffer name when attaching
This commit is contained in:
parent
6e817b3e6d
commit
4cfa7baa28
1 changed files with 3 additions and 4 deletions
|
@ -19,12 +19,11 @@ local function attach(name, buffer, content, nowait)
|
|||
error("already attached to buffer " .. name)
|
||||
end
|
||||
if buffer == nil then
|
||||
buffer = vim.api.nvim_create_buf(true, true)
|
||||
vim.api.nvim_set_option_value('fileformat', 'unix', { buf = buffer })
|
||||
-- vim.api.nvim_buf_set_option(buffer, 'filetype', 'codemp') -- TODO get from codemp?
|
||||
vim.api.nvim_buf_set_name(buffer, name)
|
||||
buffer = vim.api.nvim_create_buf(true, false)
|
||||
vim.api.nvim_set_current_buf(buffer)
|
||||
end
|
||||
vim.api.nvim_set_option_value('fileformat', 'unix', { buf = buffer })
|
||||
vim.api.nvim_buf_set_name(buffer, name)
|
||||
local controller = session.workspace:attach_buffer(name):await()
|
||||
if not nowait then
|
||||
controller:poll():await() -- wait for current state to get synched
|
||||
|
|
Loading…
Reference in a new issue