experimental

This commit is contained in:
2025-06-12 22:48:17 -06:00
parent 7f85848620
commit 9054f4453f
7 changed files with 283 additions and 62 deletions

View File

@@ -22,10 +22,29 @@ tracker.create_effect(function()
-- constructed with `h(...)` calls). To help organize the markup, text and
-- tags can be nested in tables at any depth. Line breaks must be specified
-- manually, with '\n'.
local text_ref = ui_buf.renderer:create_ref()
ui_buf:render {
'Reactive Counter Example\n',
'========================\n\n',
{
'Text field: ',
h('text', { hl = 'DiffAdd', ref = text_ref }, { '[]' }),
'\n',
h('text', {
hl = 'DiffAdd',
nmap = {
['<CR>'] = function()
vim.notify(text_ref:text())
return ''
end,
},
}, ' Submit '),
},
'\n',
'\n',
{ 'Counter: ', tostring(count), '\n' },
'\n',