Comments (8)
You are right, the question mark was an oversight. I have corrected it now.
from rainbow-delimiters.nvim.
Using gentoo and compile neovim with USE flags LUA_SINGLE_TARGET="luajit
from rainbow-delimiters.nvim.
Based on the error it seems that this issue is caused by the nvim_buf_call
added to strategy
in the last commit, so for now you can probably go back one commits to get around this problem.
I can reproduce the error by setting up the (default) strategy via a function instead of setting it up immediately.
An easy fix for now is to not use nvim_buf_call
for strategy
(like it was before).
@HiPhish: If you switch to a setup where the functions can accept an optional bufnr
, you should probably double check setting up the strategy
via a function, since it has a different behavior in the current version compared to query
and priority
(both of those work fine with functions for me). I haven't really looked into this, but I can't immediately tell what causes this difference.
from rainbow-delimiters.nvim.
This is really weird because it works for the query. I can confirm that it is broken for strategies though, but only if using nvim_buf_call
. I will switch to a function that uses an optional bufnr
argument. The error is really weird, I don't understand why it is happening. It looks like returning a table that has function values is where things break. Here is a minimal example which replicates the error:
vim.api.nvim_buf_call(0, function() return {a = function() return 'x' end} end)
@jczhang02 Pleas revert one commit back for the time being. I will fix this shortly.
from rainbow-delimiters.nvim.
This is really weird because it works for the query. I can confirm that it is broken for strategies though, but only if using
nvim_buf_call
. I will switch to a function that uses an optionalbufnr
argument. The error is really weird, I don't understand why it is happening. It looks like returning a table that has function values is where things break.
Apparently this is a known limitation (that nvim_buf_call
cannot contain functions in the return value), since quote:
"nvim_buf_call is within the general Nvim API which adheres to msgpack and thus cannot return function values."
See neovim/neovim#26531 (comment).
from rainbow-delimiters.nvim.
Please try the current master
branch now, it should be fixed. The configuration function can now take the current buffer number as an argument if you want to.
from rainbow-delimiters.nvim.
Please try the current
master
branch now, it should be fixed. The configuration function can now take the current buffer number as an argument if you want to.
It works as I would expect (and LuaLS doesn't even complain about functions of the form function() return ... end
which I thought it would with the given type annotations).
I have one note/question: In lib.lua
line 71, we have ---@param bufnr integer? Use this buffer as the current buffer
, but can bufnr ever be nil? By the type annotations of the query, we expect a function that takes a non-nil bufnr.
from rainbow-delimiters.nvim.
Closing this as done.
from rainbow-delimiters.nvim.
Related Issues (20)
- [Bug]: Bad performance for big files, even with noop HOT 3
- [Bug]: Majoring stuttering in Zig files HOT 8
- [Bug]: slow down in markdown HOT 4
- [Bug]: Error messages keep popup and preventing me to edit file HOT 3
- [Bug]: Rainbow delimiters no longer working for C# files HOT 3
- Use LanguageTree:children() instead of the deprecated LanguageTree:for_each_child() HOT 4
- [Bug]: not work for java with nvim-treesitter main branch
- [Bug]: Getting error hovering in Haskell HOT 2
- [Bug]: Error when calling vim.lsp.buf.hover HOT 5
- [Bug]: Error E475 when using Neovim nightly HOT 1
- [Bug]: Vue tag display is abnormal HOT 1
- [Bug]: How to turn off the coloring of brackets for useless code? HOT 7
- [Question]: highlights do not keep when fold text HOT 4
- [Bug]: not all brackets are colorized in java HOT 2
- [Bug] With tsx, highlighting of delimiters is inconsistent when trying to include attribute names HOT 5
- [Bug]: Rainbow fails to update or install due to gitlab access right issues HOT 2
- [Enhancement]: Support jsdoc types for javascript/typescript HOT 1
- [Bug]: lua_ls hangs on startup HOT 5
- [Bug]: does not work HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rainbow-delimiters.nvim.