Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: enable_close_on_slash should close the innermost child #209

Open
aarondill opened this issue Aug 5, 2024 · 3 comments
Open

BUG: enable_close_on_slash should close the innermost child #209

aarondill opened this issue Aug 5, 2024 · 3 comments
Labels

Comments

@aarondill
Copy link

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" })
@PriceHiller
Copy link
Collaborator

This is related to an issue I noticed in #201.

We need to properly pick up the node pairs again.

Copy link

stale bot commented Oct 5, 2024

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.

@stale stale bot added the wontfix This will not be worked on label Oct 5, 2024
@aarondill
Copy link
Author

not stale.

@stale stale bot removed the wontfix This will not be worked on label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants