Skip to content

Autoreload cached mappings on query save #787

@lf-

Description

@lf-

Is your feature request related to a problem? Please describe.

I want to be able to :TSEditQuery to edit a query and then save it and then have it work.

Currently this is jacked because treesitter-textobjects caches queryable objects in the key map:

:lua pp(require('nvim-treesitter.textobjects.select').keymaps_per_buf[62])
{ {
    lhs = "aa",
    mode = "o"
  }, {
    lhs = "aa",
    mode = "x"
  }, {
    lhs = "if",
    mode = "o"
  }, {
    lhs = "if",
    mode = "x"
  } }

M.keymaps_per_buf = {}
function M.attach(bufnr, lang)

Describe the solution you'd like
The keymaps should be detached and reattached on query save IMO.

Describe alternatives you've considered
You can restart vim I guess, that is no fun.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions