styled-components / vim-styled-components

Vim bundle for http://styled-components.com based javascript files.
300 stars 24 forks source link

Highlighting lost based on cursor position #49

Closed AlanWarren closed 6 years ago

AlanWarren commented 6 years ago

Hello,

When editing large components with many nested styled component definitions, i will often see everything below my styled component definitions highlight as jsTemplateString until I move the cursor back within a styled component's definition.

I'm using a fairly default setup, with pangloss JS highlighting and vim-jsx-improve.

Few pics with different cursor positions. screen shot 2018-08-22 at 10 38 32 am screen shot 2018-08-22 at 10 38 54 am

Thanks!

AlanWarren commented 6 years ago

Sorry, I forgot to include this. I've tossed together a minimal init.vim. The above screenshots use my own colorscheme, but I tried a few popular ones I found on google, and they did the same thing.

call plug#begin('~/.config/nvim/plugged')
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
call plug#end()

colorscheme PaperColor-Dark
set termguicolors
set t_Co=256
set t_ut=

I have some experience with hacking at syntax files, and I'm willing to put some effort towards this, but I'm honestly a bit lost due to the cursor issue. I'm not sure why the highlighting cares where my caret is. ¯_(ツ)_/¯

ty sir

AlanWarren commented 6 years ago

I had a javascript syntax file with some custom rules inside .config/nvim/after/syntax that was causing this issue.

My apologies.

fleischie commented 6 years ago

Oh, nice. I completely forgot to look at this, sorry. But awesome, that you were able to fix it on your own.

I'll be more responsive next issue, promised. 🙏