watch text-changes with signals
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m23s
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m23s
This commit is contained in:
@@ -22,29 +22,10 @@ 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',
|
||||
|
||||
Reference in New Issue
Block a user