Skip to content
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

Cursor does not appear when using vim keymap. #240

Open
stephenholtz opened this issue Apr 6, 2020 · 4 comments
Open

Cursor does not appear when using vim keymap. #240

stephenholtz opened this issue Apr 6, 2020 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@stephenholtz
Copy link

Description

When using vim as the text editor keymap, syntax highlighting obscures the cursor. There don't appear to be any relevant codemirror extensions settings.

Firefox:
cursor_problem

$ jupyter --version
jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : not installed
ipython          : 7.13.0
ipykernel        : 5.2.0
jupyter client   : 6.1.2
jupyter lab      : 2.0.1
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.4
traitlets        : 4.3.3
$ jupyter labextension krassowski/jupyterlab-lsp --version
2.0.1

This occurs in Firefox and Chrome on OSX 10.15.4. Although on Chrome the edge of the cursor is just barely visible, so Chrome+zoom page is my current workaround.

Expected behavior

I think the cursor should be visible on top of the highlighting.

@krassowski krassowski added the bug Something isn't working label Apr 8, 2020
@krassowski
Copy link
Member

Thank you for opening this issue. I will have a look over the weekend.

@krassowski
Copy link
Member

This is difficult and not specific to this extension. Long story short, the cursor is usually placed on top with z-index 1, but in the vim mode it is placed under the text with z-index 3. Now, all the token-based highlighters, including the built-in search of JupyterLab and the match highlighter add-on from codemirror create the highlight effect by adding a background to the token; we cannot have a cursor between the background and the text in HTML (as far as I know).

The line highlight feaure works this problem around by using a custom presentation layer which is below all tokens (and below the cusors); it might be possible to rewrite our highlights to use a similar mechanism (the positioning is possible - this is how cursros are made), but not trivial.

@krassowski
Copy link
Member

One way around it would be to change z-index of the cursor to place in at the top and make it semi-transparent (or only border/outline, with transparent inside).

@stephenholtz
Copy link
Author

Thanks for looking into this and opening the Jupyterlab issue, it seems like the right place to get a solution implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants