diff options
Diffstat (limited to 'test/functional/ui')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 35 | ||||
-rw-r--r-- | test/functional/ui/screen.lua | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 1b3d4afd5f..7b3533454c 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -2205,6 +2205,41 @@ describe('extmark decorations', function() | ]]} end) + + it('supports URLs', function() + insert(example_text) + + local url = 'https://example.com' + + local attrs = screen:get_default_attr_ids() + table.insert(attrs, { + url = url, + }) + screen:set_default_attr_ids(attrs) + + api.nvim_buf_set_extmark(0, ns, 1, 4, { + end_col = 14, + url = url, + }) + + screen:expect{grid=[[ + for _,item in ipairs(items) do | + {44:local text}, hl_id_cell, count = unpack(item) | + if hl_id_cell ~= nil then | + hl_id = hl_id_cell | + end | + for _ = 1, (count or 1) do | + local cell = line[colpos] | + cell.text = text | + cell.hl_id = hl_id | + colpos = colpos+1 | + end | + en^d | + {1:~ }| + {1:~ }| + | + ]]} + end) end) describe('decorations: inline virtual text', function() diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index a02130276d..3043a3c60a 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -1890,6 +1890,7 @@ function Screen:_equal_attrs(a, b) and a.strikethrough == b.strikethrough and a.fg_indexed == b.fg_indexed and a.bg_indexed == b.bg_indexed + and a.url == b.url end function Screen:_equal_info(a, b) |