-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List comprehension is highlighted as error! #94
Comments
I can not reproduce this, so I'll need more details. Does it happen under all circumstances, or do you have a specific example? Does the error persist if you refresh the file with |
Sorry, I the error happens when I use the below is my .vimrc call plug#begin('~/.vim/plugged')
Plug 'JuliaEditorSupport/julia-vim'
Plug 'luochen1990/rainbow'
call plug#end()
syntax enable
filetype plugin indent on
let g:rainbow_active = 1
let g:rainbow_conf = {
\ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'],
\ 'ctermfgs': ['darkgreen', 'darkblue', 'darkgray', 'brown', 'darkcyan', 'darkred', 'darkmagenta', 'gray', 'black', 'red'],
\ 'operators': '_,_',
\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'],
\ 'separately': {
\ '*': {},
\ 'julia': {
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/', 'start=/(/ end=/)/ containedin=juliaConditionalBlock', 'start=/\[/ end=/\]/ containedin=juliaConditionalBlock', 'start=/{/ end=/}/ containedin=juliaConditionalBlock', 'start=/(/ end=/)/ containedin=juliaModuleBlock', 'start=/\[/ end=/\]/ containedin=juliaModuleBlock', 'start=/{/ end=/}/ containedin=juliaModuleBlock', 'start=/(/ end=/)/ containedin=juliaFunctionBlock', 'start=/\[/ end=/\]/ containedin=juliaFunctionBlock', 'start=/{/ end=/}/ containedin=juliaFunctionBlock', 'start=/(/ end=/)/ containedin=juliaRepeatBlock', 'start=/\[/ end=/\]/ containedin=juliaRepeatBlock', 'start=/{/ end=/}/ containedin=juliaRepeatBlock', 'start=/(/ end=/)/ containedin=juliaModuleBlock', 'start=/\[/ end=/\]/ containedin=juliaModuleBlock', 'start=/{/ end=/}/ containedin=juliaModuleBlock'],
\ },
\ 'vim': {
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'],
\ },
\ Could you advise some hint? Many thanks. |
I have investigated the issue. The problem is that rainbow supersedes the syntax file definitions of the parentheses. As a quick fix for the issue at hand, you can just add However, you should be aware that 1) there are more block types than the ones you have defined (see here); 2) the syntax file uses My advice is to just disable rainbow for julia files... |
Thank you for your solution! I have been able to config it to recognize 1 level list comprehension. I still get an error for list of list comprehension, but 1 level is enough for me currently. |
@ngphuoc Apologies for reviving this long-dead issue, but do you mind sharing the snippet of your config that helped you resolve the problem for 1 level of list comprehensions? I hope you still have a copy of it. |
I also apologize for reviving this another 2 years later. I would love a solution for this as I am hitting the exact same issue with |
The closing square bracket is highlighted as error in
[i for i in 1:10]
The text was updated successfully, but these errors were encountered: