sainnhe / edge

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

Undercurl highlights rendered as underline #52

Closed markstory closed 2 years ago

markstory commented 2 years ago

Operating system/version

macOS Big Sur 11.6

Terminal emulator/version

Kitty 0.24.3

$TERM environment variable

xterm-kitty

Tmux version

tmux 3.2a

Feature matrix


compe: health#compe#check
========================================================================
## compe:snippet
  - INFO: snippet engine is not detected.

## compe:mapping
  - INFO: `compe#complete` is not mapped
  - INFO: `compe#confirm` is not mapped
  - INFO: `compe#close` is not mapped
  - INFO: `compe#scroll` is not mapped

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $TERM_PROGRAM='tmux'
  - INFO: $COLORTERM='truecolor'

## tmux
  - OK: escape-time: 0
  - INFO: Checking stuff
  - WARNING: `focus-events` is not enabled. |'autoread'| may not work.
    - ADVICE:
      - (tmux 1.9+ only) Set `focus-events` in ~/.tmux.conf:
          set-option -g focus-events on
  - INFO: $TERM: xterm-kitty
  - ERROR: $TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.
    - ADVICE:
      - Set default-terminal in ~/.tmux.conf:
          set-option -g default-terminal "screen-256color"
      - https://github.com/neovim/neovim/wiki/FAQ

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.2 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v16.13.1 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: Apple clang version 12.0.5 (clang-1205.0.22.11)
  - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - toml           ✓ ✓ ✓ ✓ ✓ 

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: pyenv: Path: /opt/homebrew/Cellar/pyenv/2.2.3/libexec/pyenv
  - INFO: pyenv: Root: /Users/markstory/.pyenv
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help |provider-python|
          /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
          python2.6 not found in search path or not executable.
          /Users/markstory/code/getsentry/.venv/bin/python is Python 3.8 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: pyenv: Path: /opt/homebrew/Cellar/pyenv/2.2.3/libexec/pyenv
  - INFO: pyenv: Root: /Users/markstory/.pyenv
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 3:
          /Users/markstory/code/getsentry/.venv/bin/python3 does not have the "neovim" module. :help |provider-python|
          python3.10 not found in search path or not executable.
          /opt/homebrew/bin/python3.9 does not have the "neovim" module. :help |provider-python|
          /Users/markstory/.pyenv/shims/python3.8 does not have the "neovim" module. :help |provider-python|
          python3.7 not found in search path or not executable.
          python3.6 not found in search path or not executable.
          /Users/markstory/code/getsentry/.venv/bin/python does not have the "neovim" module. :help |provider-python|
  - INFO: Executable: Not found

## Python virtualenv
  - INFO: $VIRTUAL_ENV is set to: /Users/markstory/code/getsentry/.venv
  - INFO: Python version: 3.8.12
  - OK: $VIRTUAL_ENV provides :!python.

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v16.13.1
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /Users/markstory/.cache/nvim/lsp.log
  - INFO: Log size: 450 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 13
  - OK: Loaded parser for toml: ABI version 13

Minimal vimrc that can reproduce this bug.

call plug#begin()

" Theme
Plug 'sainnhe/edge'
-- Default color scheme
vim.g.noshowmode = true
vim.g.termguicolors = true
vim.cmd("set background=light")

-- Theme configuration
vim.g.edge_enable_italic = 1
vim.g.edge_diagnostic_line_highlight = 1

vim.cmd("colorscheme edge")

Steps to reproduce this bug using minimal vimrc

Thank you for publishing this, I'm really loving the colorscheme. This is less of a bug report and more of a question/proposal.

  1. Launch neovim and open a file that contains LSP dignostic errors.

Expected behavior

I was hoping to see undercurls used when the highlight groups say undercurl.

Changing line 156 of the cited block to 'undercurl' updates the output to use undercurls correctly. Would you be open to using actual undercurls used (based on a configuration flag that defaults to the current behavior)?

Actual behavior

I've noticed that the edge#highlight converts undercurl to underline when generating the highlight definition. This results in a straight underline being used:

Screen Shot 2022-03-07 at 2 43 28 PM

I tracked this down to this block:

https://github.com/sainnhe/edge/blob/825421f15fbba5ccf7ab374290369e53c915c60c/autoload/edge.vim#L155-L157

sainnhe commented 2 years ago

Does this work for you?

diff --git a/autoload/edge.vim b/autoload/edge.vim
index cf6087e..268f44d 100644
--- a/autoload/edge.vim
+++ b/autoload/edge.vim
@@ -152,9 +152,7 @@ function! edge#highlight(group, fg, bg, ...) "{{{
           \ a:1 :
           \ 'NONE')
         \ 'cterm=' . (a:0 >= 1 ?
-          \ (a:1 ==# 'undercurl' ?
-            \ 'underline' :
-            \ a:1) :
+          \ a:1 :
           \ 'NONE')
         \ 'guisp=' . (a:0 >= 2 ?
           \ a:2[0] :
markstory commented 2 years ago

Does this work for you?

Yes it does!

markstory commented 2 years ago

Thank you!