ghostbuster91/nvim-next

Treesitter-textobjects example from front page doesn't work

Hubro opened this issue · 2 comments

Hubro commented

I implemented the gitsigns example, which worked, but the treesitter-textobjects one doesn't. Here's my relevant config:

require("nvim-next.integrations").treesitter_textobjects()

require("nvim-treesitter.configs").setup({

  -- ...

  textobjects = {
    select = {
      enable = true,
      lookahead = true,
      include_surrounding_whitespace = false,

      keymaps = {
        ["af"] = "@function.outer",
        ["if"] = "@function.inner",
        ["ac"] = "@comment.outer",
        ["ic"] = "@comment.inner",
        ["ap"] = "@parameter.outer",
        ["ip"] = "@parameter.inner",
      },

      selection_modes = {},
    },

    swap = {
      enable = true,
      swap_next = {
        ["<leader>+"] = "@parameter.inner",
      },
      swap_previous = {
        ["<leader>-"] = "@parameter.inner",
      },
    },
  },

  nvim_next = {
    textobjects = {
      enable = true,

      move = {
        -- enable = true,
        -- set_jumps = true,
        goto_next_start = {
          ["]f"] = "@function.outer",
        },
        goto_previous_start = {
          ["[f"] = "@function.outer",
        },
      },
    },
  },
})

This simply does nothing right now. No errors, but nothing gets bound to ]f or [f either.

Indeed the enable was incorrectly nested. I pushed a fix, could you try again?

Hubro commented

That did it! I almost immediately discovered another bug though, but I'll make a new issue for that 😅