@@ -2213,4 +2213,134 @@ describe('builtin popupmenu', function()
2213
2213
feed('<c-y>')
2214
2214
assert_alive()
2215
2215
end)
2216
+
2217
+
it('truncates double-width character correctly when there is no scrollbar', function()
2218
+
screen:try_resize(32,8)
2219
+
command('set completeopt+=menuone,noselect')
2220
+
feed('i' .. string.rep(' ', 13))
2221
+
funcs.complete(14, {'哦哦哦哦哦哦哦哦哦哦'})
2222
+
screen:expect([[
2223
+
^ |
2224
+
{1:~ }{n: 哦哦哦哦哦哦哦哦哦>}|
2225
+
{1:~ }|
2226
+
{1:~ }|
2227
+
{1:~ }|
2228
+
{1:~ }|
2229
+
{1:~ }|
2230
+
{2:-- INSERT --} |
2231
+
]])
2232
+
end)
2233
+
2234
+
it('truncates double-width character correctly when there is scrollbar', function()
2235
+
screen:try_resize(32,8)
2236
+
command('set completeopt+=noselect')
2237
+
command('set pumheight=4')
2238
+
feed('i' .. string.rep(' ', 12))
2239
+
local items = {}
2240
+
for _ = 1, 8 do
2241
+
table.insert(items, {word = '哦哦哦哦哦哦哦哦哦哦', equal = 1, dup = 1})
2242
+
end
2243
+
funcs.complete(13, items)
2244
+
screen:expect([[
2245
+
^ |
2246
+
{1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{c: }|
2247
+
{1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{c: }|
2248
+
{1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{s: }|
2249
+
{1:~ }{n: 哦哦哦哦哦哦哦哦哦>}{s: }|
2250
+
{1:~ }|
2251
+
{1:~ }|
2252
+
{2:-- INSERT --} |
2253
+
]])
2254
+
end)
2255
+
end)
2256
+
2257
+
describe('builtin popupmenu with ui/ext_multigrid', function()
2258
+
local screen
2259
+
before_each(function()
2260
+
clear()
2261
+
screen = Screen.new(32, 20)
2262
+
screen:attach({ext_multigrid=true})
2263
+
screen:set_default_attr_ids({
2264
+
-- popup selected item / scrollbar track
2265
+
['s'] = {background = Screen.colors.WebGray},
2266
+
-- popup non-selected item
2267
+
['n'] = {background = Screen.colors.LightMagenta},
2268
+
-- popup scrollbar knob
2269
+
['c'] = {background = Screen.colors.Grey0},
2270
+
[1] = {bold = true, foreground = Screen.colors.Blue},
2271
+
[2] = {bold = true},
2272
+
[3] = {reverse = true},
2273
+
[4] = {bold = true, reverse = true},
2274
+
[5] = {bold = true, foreground = Screen.colors.SeaGreen},
2275
+
[6] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
2276
+
})
2277
+
end)
2278
+
2279
+
it('truncates double-width character correctly when there is no scrollbar', function()
2280
+
screen:try_resize(32,8)
2281
+
command('set completeopt+=menuone,noselect')
2282
+
feed('i' .. string.rep(' ', 13))
2283
+
funcs.complete(14, {'哦哦哦哦哦哦哦哦哦哦'})
2284
+
screen:expect({grid=[[
2285
+
## grid 1
2286
+
[2:--------------------------------]|
2287
+
[2:--------------------------------]|
2288
+
[2:--------------------------------]|
2289
+
[2:--------------------------------]|
2290
+
[2:--------------------------------]|
2291
+
[2:--------------------------------]|
2292
+
[2:--------------------------------]|
2293
+
[3:--------------------------------]|
2294
+
## grid 2
2295
+
^ |
2296
+
{1:~ }|
2297
+
{1:~ }|
2298
+
{1:~ }|
2299
+
{1:~ }|
2300
+
{1:~ }|
2301
+
{1:~ }|
2302
+
## grid 3
2303
+
{2:-- INSERT --} |
2304
+
## grid 4
2305
+
{n: 哦哦哦哦哦哦哦哦哦>}|
2306
+
]], float_pos={[4] = {{id = -1}, 'NW', 2, 1, 12, false, 100}}})
2307
+
end)
2308
+
2309
+
it('truncates double-width character correctly when there is scrollbar', function()
2310
+
screen:try_resize(32,8)
2311
+
command('set completeopt+=noselect')
2312
+
command('set pumheight=4')
2313
+
feed('i' .. string.rep(' ', 12))
2314
+
local items = {}
2315
+
for _ = 1, 8 do
2316
+
table.insert(items, {word = '哦哦哦哦哦哦哦哦哦哦', equal = 1, dup = 1})
2317
+
end
2318
+
funcs.complete(13, items)
2319
+
screen:expect({grid=[[
2320
+
## grid 1
2321
+
[2:--------------------------------]|
2322
+
[2:--------------------------------]|
2323
+
[2:--------------------------------]|
2324
+
[2:--------------------------------]|
2325
+
[2:--------------------------------]|
2326
+
[2:--------------------------------]|
2327
+
[2:--------------------------------]|
2328
+
[3:--------------------------------]|
2329
+
## grid 2
2330
+
^ |
2331
+
{1:~ }|
2332
+
{1:~ }|
2333
+
{1:~ }|
2334
+
{1:~ }|
2335
+
{1:~ }|
2336
+
{1:~ }|
2337
+
## grid 3
2338
+
{2:-- INSERT --} |
2339
+
## grid 4
2340
+
{n: 哦哦哦哦哦哦哦哦哦>}{c: }|
2341
+
{n: 哦哦哦哦哦哦哦哦哦>}{c: }|
2342
+
{n: 哦哦哦哦哦哦哦哦哦>}{s: }|
2343
+
{n: 哦哦哦哦哦哦哦哦哦>}{s: }|
2344
+
]], float_pos={[4] = {{id = -1}, 'NW', 2, 1, 11, false, 100}}})
2345
+
end)
2216
2346
end)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4