Skip to content

[audit] nvim-treesitter-textobjects: tso.setup({ move }) set_jumps may be silently ignored #72

@stanfish06

Description

@stanfish06

What

plugin_config.lua calls:

tso.setup({
    move = {
        set_jumps = true,
    },
})

After the nvim-treesitter / nvim-treesitter-textobjects major refactor (late 2024), the plugin was decoupled from the old require("nvim-treesitter.configs").setup() integration. The top-level tso.setup() now primarily initialises the standalone plugin — it is not documented as forwarding move.set_jumps to the move module.

Where

lua/config/plugin_config.lua:146-149

Why it matters

If set_jumps is silently ignored, the ]f / [f / ]c / [c motions will not add positions to the jumplist (<C-o> / <C-i> won't go back to where you came from). This degrades navigation in large files without any visible error.

Recommended action

Verify that jumping via ]f then <C-o> returns to the original position. If it does not, replace the module-level set_jumps option with an explicit parameter on each call:

vim.keymap.set({ "n", "x", "o" }, "]f", function()
    move.goto_next_start("@function.outer", "textobjects", { set_jumps = true })
end, { desc = "Next function start" })
-- repeat for [f, ]c, [c, ]F, [F, ]C, [C

Passing set_jumps per-call is the pattern used in the plugin's own README examples post-refactor and is guaranteed to work regardless of what tso.setup() does with the option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions