Skip to content

Typo in nvim-treesitter config prevents indentexpr from being set (indent vs indents) #1995

@JackHerby

Description

@JackHerby

Before Reporting an Issue

  • I have read the kickstart.nvim README.md.

  • I have read the appropriate plugin's documentation.

  • I have searched that this issue has not been reported before.

  • [*] By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.

Describe the bug

Treesitter indentation check fails silently due to a typo in query_name parameter of vim.treesitter.query.get() method.
The parameter in line:

local has_indent_query = vim.treesitter.query.get(language, 'indent') ~= nil

should be indents, not indent. As a result, the check always evaluates to false, and indentation falls back to Neovim's default.

To Reproduce

  1. Ensure Treesitter based indentation is enabled in the config.
  2. Open a file that has its corresponding tree-sitter parser installed (e.g., a .lua or .vue file).
  3. Check the value of indentexpr (using :set indentexpr?, or with Lua print). The output will show the default Neovim fallback (e.g., HtmlIndent()) instead of the expected v:lua.require'nvim-treesitter'.indentexpr()

I've mentioned Vue.js filetype, because that's what I work with on daily basis. Since it's a minor fix, I'd love to submit a PR with a fix.

Desktop

  • OS: Arch Linux x86_64
  • Terminal: ghostty 1.3.1-arch2

Neovim Version

NVIM v0.12.1
Build type: RelWithDebInfo
LuaJIT 2.1.1774896198

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions