mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 15:34:53 +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)
|
error("already attached to buffer " .. name)
|
||||||
end
|
end
|
||||||
if buffer == nil then
|
if buffer == nil then
|
||||||
buffer = vim.api.nvim_create_buf(true, true)
|
buffer = vim.api.nvim_create_buf(true, false)
|
||||||
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)
|
|
||||||
vim.api.nvim_set_current_buf(buffer)
|
vim.api.nvim_set_current_buf(buffer)
|
||||||
end
|
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()
|
local controller = session.workspace:attach_buffer(name):await()
|
||||||
if not nowait then
|
if not nowait then
|
||||||
controller:poll():await() -- wait for current state to get synched
|
controller:poll():await() -- wait for current state to get synched
|
||||||
|
|
Loading…
Reference in a new issue