@@ -76,7 +76,39 @@ describe('screenchar() and family respect floating windows', function()
7676 describe (' with ext_multigrid' , function ()
7777 with_ext_multigrid (true )
7878 end )
79+
7980 describe (' without ext_multigrid' , function ()
8081 with_ext_multigrid (false )
8182 end )
83+
84+ describe (' hidden windows' , function ()
85+ before_each (function ()
86+ clear ()
87+ Screen .new (40 , 7 , {})
88+ api .nvim_buf_set_lines (0 , 0 , - 1 , true , { ' aaa' , ' aaa' })
89+ end )
90+
91+ local assert_screen_funcs = function ()
92+ eq (' a' , fn .screenstring (1 , 1 ))
93+ eq (97 , fn .screenchar (1 , 1 ))
94+ eq ({ 97 }, fn .screenchars (1 , 1 ))
95+ eq (fn .screenattr (2 , 1 ), fn .screenattr (1 , 1 ))
96+ end
97+
98+ it (' manual' , function ()
99+ local bufnr = api .nvim_create_buf (false , true )
100+ api .nvim_buf_set_lines (bufnr , 0 , - 1 , true , { ' bb' })
101+ local win_opts = { relative = ' editor' , row = 0 , col = 0 , height = 1 , width = 2 , hide = true }
102+ api .nvim_open_win (bufnr , false , win_opts )
103+
104+ assert_screen_funcs ()
105+ end )
106+
107+ it (' from ui2' , function ()
108+ n .exec_lua (' require("vim._extui").enable({ enable = true })' )
109+ command (' echo "foo"' )
110+
111+ assert_screen_funcs ()
112+ end )
113+ end )
82114end )
0 commit comments