Skip to content

vim-smoothie and nvim-treesitter-context have conflict #594

@Freed-Wu

Description

@Freed-Wu

Description

Install two plugins:
https://github.com/psliwka/vim-smoothie and https://github.com/nvim-treesitter/nvim-treesitter-context
then edit a lua file, such as https://github.com/nvim-treesitter/nvim-treesitter-context 's lua/treesitter-context/context.lua , press any hotkey of vim-smoothie, such as <C-D> (for me, 2 times), an error:

Error detected while processing CursorMoved Autocommands for "*":
Error executing lua callback: .../wzy/.local/rocks_rtp/lua/treesitter-context/context.lua:81: attempt to call method 'range' (a nil value)
stack traceback:
        .../wzy/.local/rocks_rtp/lua/treesitter-context/context.lua:81: in function 'fn'
        /home/wzy/.local/rocks_rtp/lua/treesitter-context/cache.lua:14: in function 'context_range'
        .../wzy/.local/rocks_rtp/lua/treesitter-context/context.lua:296: in function 'get_context'
        /home/wzy/.local/rocks_rtp/lua/treesitter-context.lua:101: in function 'f'
        /home/wzy/.local/rocks_rtp/lua/treesitter-context.lua:27: in function </home/wzy/.local/rocks_rtp/lua/treesitter-context.lua:21>

OS: Arch Linux
NVIM v0.11.0
Build type: RelWithDebInfo
LuaJIT 2.1.1736781742
Run "nvim -V1 -v" for more info
vim-smoothie is git version
nvim-treesitter-context is luarocks' latest version

I tend to think this is due to vim-smoothie do some weird thing during CursorMoved ? Maybe @psliwka know.

Neovim version

0.11.0

Expected behavior

No error

Actual behavior

Error

Minimal config

local plugins = {
  ts         = 'https://github.com/psliwka/vim-smoothie',
  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. edit a lua file
  3. press <C-D>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions