sainnhe / edge

Clean & Elegant Color Scheme inspired by Atom One and Material
MIT License
860 stars 56 forks source link

Curly brace not colored in Template literal #34

Closed leiswatch closed 3 years ago

leiswatch commented 3 years ago

Hey! I wanted to thank you for this amazing colorscheme, I love it. There is just one small issue that is a little bit annoying - in Javascript/Typescript files, the closing curly brace of a placeholder in template literal is not colored. Is there a way to fix this? Thanks!

image

sainnhe commented 3 years ago

Can't reproduce, please follow the issue template to provide detailed information, especially the syntax highlighting plugin you are using.

leiswatch commented 3 years ago

name: Curly brace not colored in Template literal about: Closing curly brace in Template literal is not colored when used with treesitter title: '' labels: bug assignees: ''


- `Operating system/version`: Linux archlinux 5.12.9-arch1-1 #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000 x86_64 GNU/Linux

- `Terminal emulator/version`: Gnome Terminal 3.40.2

- `echo $TERM`: xterm-256color

- `vim --version` or `nvim --version`: NVIM v0.5.0-dev+1384-gf2906a466

Minimal vimrc that can reproduce this bug

call plug#begin('~/.config/nvim/plugged')
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'sainnhe/edge'
call plug#end()

if (has("termguicolors"))
  set termguicolors
endif

lua <<EOF
  require "nvim-treesitter.configs".setup {
    ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
    highlight = {
      enable = true,              -- false will disable the whole extension
    }
  }
EOF

let g:edge_enable_italic = 1
let g:edge_disable_italic_comment = 1
let g:edge_transparent_background = 0
let g:edge_current_word = 'bold'
colorscheme edge

Steps to reproduce this bug using minimal vimrc

Create a javascript file and write

const x =`${2}`;

Actual behaviour

The closing brace is not colored.

Expected behaviour

The closing brace should be colored.

sainnhe commented 3 years ago

Screenshot_20210610_082059

The variable is not highlighted because there is no variable named John.

The curly brace is not highlighted because the left brace uses TSPunctSpecial which is linked to Yellow, while the right brace uses TSPunctBracket which is linked to Fg (i.e. white in dark bg).

I think it's a bug of nvim-treesitter, the two curly braces should use the same highlight group.

sainnhe commented 3 years ago

I can't fix it in color scheme level, so close this.