jupyterlab-contrib / jupyterlab-vim

Vim notebook cell bindings for JupyterLab
https://jupyterlab-contrib.github.io/jupyterlab-vim.html
MIT License
660 stars 43 forks source link

Highlight parenthesis character only and not the entire block #118

Open joelostblom opened 9 months ago

joelostblom commented 9 months ago

Originally from https://github.com/jupyterlab/jupyterlab/issues/15196 where it was suggested that this is a better fit for jupyterlab-vim

Problem

Currently, matching parenthesis are indicated by highlighting the entire block the parenthesis is in, rather than just the parenthesis character itself. This makes it difficult to tell apart the cursor from the highlighted parenthesis as they melt into each other as you can see in this short clip:

https://github.com/jupyterlab/jupyterlab/assets/4560057/a0d39266-fed4-415d-a1df-b646cccb6573

a block cursor from a highlight parenthesis and is confusing when moving through text quickly.

Proposed Solution

I think it is much easier to keep track of the cursor position if just the parenthesis character is highlighted, rather than the entire block. This is how things look in vim for me:

https://github.com/jupyterlab/jupyterlab/assets/4560057/c7322fea-935e-4a26-854e-dbd98749d0d1

Additional context

I believe this is a recent change, possibly new in 4.0, because I recently upgraded from 3.6 and immediately reacted to how hard it was to tell where my cursor is. Note that I do use vim mode for the cursor to be a block, but I believe this is a general issue for any block cursor.

Any CSS workaround that can be applied right away until there is a fix forthis would be much appreciated. I think this also affect non-block cursors to a lesser extent because the block highlight generally introduces more visual noise

firai commented 7 months ago

By the way, whether matching parentheses in vim are highlighted as blocks or as a foreground color seems to depend on the theme. I use Gruvbox and matching parentheses are highlighted as blocks, so the current behavior matches what I see in vim.