@@ -40,8 +40,8 @@ function M.term_supported()
40
40
local info = x11 .term_get_info ()
41
41
return info .xpixel ~= 0 and info .ypixel ~= 0
42
42
end
43
- function M .term_set_size ()
44
- x11 .win_position (x11 .term_root ,0 ,0 ,x11 . screen_get_size () )
43
+ function M .term_set_size (width , height )
44
+ x11 .win_position (x11 .term_root ,0 ,0 ,width , height )
45
45
end
46
46
47
47
function M .win_update_all (event )
@@ -194,10 +194,13 @@ function M.step()
194
194
M .key_handle (ev .win ,ev .key ,ev .mod )
195
195
elseif ev .type == ' destroy' then
196
196
M .win_del_buf (ev .win )
197
- elseif ev .type == ' _update' then --- HACK: see x11.lua
198
- M .win_update_all ()
199
197
elseif ev .type == ' focus' then
200
198
M .win_goto (ev .win )
199
+ elseif ev .type == ' resize' then
200
+ if ev .win == x11 .true_root then
201
+ M .term_set_size (ev .width ,ev .height )
202
+ end
203
+ M .win_update_all ()
201
204
elseif ev .type == ' other' then
202
205
if M .conf .verbose then
203
206
vim .notify (' event not handled ' .. x11 .code_to_name [ev .type_id ],vim .log .levels .INFO )
@@ -216,7 +219,7 @@ function M.start()
216
219
vim .api .nvim_create_autocmd ({' WinEnter' ,' BufWinEnter' ,' TabEnter' },{callback = function ()
217
220
vim .schedule_wrap (M .win_update_all )(' enter' )
218
221
end ,group = M .augroup })
219
- M .term_set_size ()
222
+ M .term_set_size (x11 . screen_get_size () )
220
223
local function t ()
221
224
if not x11 .display then return end
222
225
M .step ()
0 commit comments