Closed bennypowers closed 1 year ago
Thanks for this update!
I've tried this out locally, and tags do complete and update as expected, but I'm getting the following error on tag completion:
E5108: Error executing lua: ...r/start/nvim-ts-autotag/lua/nvim-ts-autotag/internal.lua:450: attempt to index field 'cmd' (a function value)
stack traceback:
...r/start/nvim-ts-autotag/lua/nvim-ts-autotag/internal.lua:450: in function <...r/start/nvim-ts-autotag/lua/nvim-ts-autotag/internal.lua:446>
Not sure if this is an issue on my end or something with the update, but wanted to flag this in case.
you'll need nvim>=0.7 for that
Already there! 😅
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@BigSur
pull and try now
Boom! Problem solved. Thanks so much!
This is great but doesn't work for me. Can you maybe take a look? @bennypowers
the video you uploaded doesn't play, can you describe the error, and provide a source file?
You can clone and try the example below.
I'm using fast
not lit
import {html} from "@microsoft/fast-element";
https://github.com/thekaganugur/vite-fast-typescript-starter/blob/main/src/my-counter.ts#L9-L13
yeah that'll be on account of the generic assertion, probably
@thekaganugur I wasn't able to reproduce. I pasted this into a typescript file
const template = html<MyCounter>`
<button @click="${x => (x.count = Math.max(0, x.count - 1))}">-</button>
<span>${x => x.count}</span>
<button @click="${x => x.count++}">+</button>
`;
then, with cursor on <button
, I did
o<div>, and received:
const template = html<MyCounter>`
<button @click="${x => (x.count = Math.max(0, x.count - 1))}">-</button>
<span>${x => x.count}</span>
<button @click="${x => x.count++}">+</button>
<div></div>
`;
@bennypowers My bad, there was something wrong with my config. It works as expected. Thanks.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
not stale
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Not stale
sorry can you rebase
Will take a look p.g. in the next few days/weeks, thanks for the 👀
hey you forgot to add default value for bufnr
diff --git i/lua/nvim-ts-autotag/internal.lua w/lua/nvim-ts-autotag/internal.lua
index 1bf9b07..501acb6 100644
--- i/lua/nvim-ts-autotag/internal.lua
+++ w/lua/nvim-ts-autotag/internal.lua
@@ -528,7 +528,7 @@ M.attach = function(bufnr, lang)
if is_in_table(M.tbl_filetypes, vim.bo.filetype) then
setup_ts_tag()
if M.enable_close == true then
- vim.api.nvim_buf_set_keymap(bufnr, 'i', ">", ">", {
+ vim.api.nvim_buf_set_keymap(bufnr or 0, 'i', ">", ">", {
noremap = true,
silent = true,
callback = function()
it still not working on svelte because svelte use element
tag maybe you can ignore check template with svelte
and can you add test case.
ok thanks
closes #32
Pressing
>
in insert mode produces:then, esc
bciwp
esc produces:also refactors attach function to use lua apis instead of vim.cmd