Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Only work when execute :e to reload current file or :TSEnable rainbow #142

Open
Savitar184 opened this issue Oct 4, 2022 · 10 comments
Open

Comments

@Savitar184
Copy link

open a file it doesn't work unless i use the command

use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate',
requires = {
'p00f/nvim-ts-rainbow'
},
config = function()
require('core/treesitter')
end
}

treesitter.setup {
ensure_installed = { 'c', 'cpp', 'vim', 'lua', 'java' },

sync_install = false,

auto_install = true,

ignore_install = {},



highlight = {
  enable = true,
  disable = {},
},

rainbow = {
  enable = true,
  extended_mode = true, 
  max_file_lines = nil,
},

incremental_selection = {
    enable = true,
    keymaps = {
      init_selection = '<CR>',
      node_incremental = '<CR>',
      scope_incremental = '<BS>',
      node_decremental = '<TAB>',
    },
},

indent = {
    enable = true
}

}

@p00f
Copy link
Owner

p00f commented Oct 4, 2022

What happens if you restart nvim, open a file and do :debug e?

@Savitar184
Copy link
Author

What happens if you restart nvim, open a file and do :debug e?

捕获
nothing happened

@p00f
Copy link
Owner

p00f commented Oct 4, 2022

and if you type cont as it says in the prompt?

@Savitar184
Copy link
Author

Savitar184 commented Oct 4, 2022

and if you type cont as it says in the prompt?

it works well just like type command :e
2

@Savitar184
Copy link
Author

so how to fix it?

@p00f
Copy link
Owner

p00f commented Oct 5, 2022

idk

@hungnguyen1503
Copy link

Hi @p00f ,

I have a problem same this ticket, when I checkout to another branch, the highlight brackets are in the wrong position.
Could you please support me to set configurations to fix it?

Before checkout:
image
After checkout:
image

@Trelosto
Copy link

I had the same problem. What worked for me is moving my plugin config into a folder in the after directory.

i.e. /.config/nvim/after/plugin/treesitter.lua

Remember to remove any require from the init.lua file where it was previously contained.

@rayandrew
Copy link

Just put

vim.api.nvim_set_hl(0, "@punctuation.bracket", { link = "" })

credits to luochen1990/rainbow#163

@folliehiyuki
Copy link

Just put

vim.api.nvim_set_hl(0, "@punctuation.bracket", { link = "" })

credits to luochen1990/rainbow#163

Doesn't seem like it fixes the issue (at least for me).

My current workaround is to load nvim-ts-rainbow before nvim-treesitter with packer.nvim. It will errors out the first time Neovim is launched after running :PackerCompile, but after that everything seems to work correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants