nvim-treesitter / nvim-treesitter/nvim-treesitter-context

`:TSContextToggle` only disables treesitter-context but cannot enable

Open
#551 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Janet
Stars
3.2k
Forks
241
PR merge metrics
No merged PRs in 30d

Description

Description

:TSContextToggle used to work properly in the past.

However, now it seems it effectively functions as :TSContextDisable as it only disables treesitter-context but cannot enable treesitter-context.

Neovim version

NVIM v0.10.3

Expected behavior

No response

Actual behavior

See description.

Minimal config
local plugins = {
  ts         = 'https://github.com/nvim-treesitter/nvim-treesitter',
  ts_context = 'https://github.com/nvim-treesitter/nvim-treesitter-context',
  -- ADD ADDITIONAL PLUGINS THAT ARE _NECESSARY_ TO REPRODUCE THE ISSUE
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.o.runtimepath = install_path..','..vim.o.runtimepath
end

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
Steps to reproduce
  1. nvim --clean -u minimal.lua
  2. :TSContextToggle once to disable treesitter-context
  3. :TSContextToggle again doesn't enable treesitter-context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the :TSContextToggle command using the provided minimal.lua reproduction and verify its behavior across two invocations. Trace the command's toggle path and confirm that the second invocation re-enables treesitter-context, then repeat the reproduction steps to verify the fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.