nvim-ts-autotag
nvim-ts-autotag copied to clipboard
BUG: `enable_close_on_slash` should close the innermost child
Example:
<html>
<head>
<title>some content<*
When setting enable_close_on_slash = true (and enable_close=false)
If the cursor is at * and the user presses /, it's expected that /title> will be inserted, however, instead /html> is inserted.
Minimal Repro
---Save as ./init.lua
---Load with `nvim -u ./init.lua`
---Plugins are installed in ./.repro/plugins
---Cleanup with `rm -rf ./.repro ./init.lua`
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ -- Colorscheme. Don't blind me pls :)
"folke/tokyonight.nvim",
init = function() require("tokyonight").load() end,
opts = {
transparent = true,
dim_inactive = true,
style = "night",
styles = { sidebars = "transparent", floats = "transparent" },
},
},
{ -- Set up treesitter
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
opts = { auto_install = true },
config = function(_, opts) return require("nvim-treesitter.configs").setup(opts) end,
},
{ -- Set up autotag
"windwp/nvim-ts-autotag",
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = {
opts = {
enable_close_on_slash = true,
enable_close = false,
},
},
},
}, { root = root .. "/plugins" })