Remove default size (height/width) and make screen fit to <canvas> size
Closed this issue · 1 comments
rhysd commented
Currently inner canvas
element has fixed size and user must manage width
and height
of <neovim-editor>
component. This is because we must know lines and cols before starting nvim
(otherwise it is needed to send vim_try_resize
after nvim starting).
<neovim-editor>
(includes inner<canvas>
) is creatednvim
process starts<neovim-editor>
is attached to DOM
Now the size must be specified because we can't know the element size before attaching it to DOM.
The sequence might be:
<neovim-editor>
(includes inner<canvas>
) is created<neovim-editor>
is attached to DOM- Get the size of inner
<canvas>
and calculate lines and cols nvim
process starts with the lines and cols
Starting process will be delayed until DOM is attached. I must check the start up time change to ensure this change has small impact to it.
rhysd commented
Default size is not removal because <canvas>
doesn't have 'resize'
event... We might make a compromize with resize on <body>
resized.