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 position missing in vim mode with markdown syntax highlighting #405

Open
kyletolle opened this Issue Dec 29, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@kyletolle
Copy link

kyletolle commented Dec 29, 2018

I appreciate Standard Notes and all the hard work that goes into improving it!

Following up with an issue I initially reported on twitter as advised to here: https://twitter.com/StandardNotes/status/1078742198387126274

Overview

When using vim mode with markdown highlighting, moving through the document in normal mode, I lose the cursor highlighting when navigating through Markdown code blocks, which makes it nearly impossible to jump around and edit the text.

Steps to reproduce

  • Use macOS Mojave 10.14.1
  • Use SN 3.0.1
  • Create note using the Vim editor
  • Change language to Markdown for the syntax highlighting
  • Enter vim's insert mode (hit i)
  • Type a Markdown code block (using either 3 backticks or indent)
  • Enter vim's normal mode (hit Esc)

Actual behavior

Cursor position within the markdown code block is hidden. I cannot see the cursor at all. This means I have no idea where the cursor is when I'm trying to navigate around and type.

I'm guessing the code block's background color is obscuring the cursor highlight.

Expected behavior

Should see the cursor highlighted. So you know where the cursor is and where you're navigating. through the text.

Screenshots

  • Using vim editor
    vim editor
  • Using markdown language
    markdown language
  • What cursor highlight looks like when not in a code block
    • Notice the green box that indicates where the cursor is
      green cursor
  • No cursor highlight when cursor is within the codeblock
    • My cursor is actually at the beginning of "What" but there's no way to see that
      no cursor
  • What cursor looks like in code block after cw
    • I've done a cw to start replacing the "What" word, and you can see a white background near where the cursor is
      white cursor
  • Cursor is visible when there's whitespace at the beginning of the line
    • Here I typed a couple spaces before the word, hit Esc to get back to normal mode, and can see the cursor now, because the code block background highlighting doesn't apply here
      green cursor again
  • The cursor is visible when in insert mode and typing
    • I think this is normal and expected. It's a blinking line instead of a blinking rectangle.
      blue cursor

I hope the steps, details, and screenshots help. Please let me know if I can provide any additional information!

@mobitar

This comment has been minimized.

Copy link
Member

mobitar commented Dec 29, 2018

Hey @kyletolle, thanks for the detailed report! It looks like the cursor is hiding behind the gray code blocks in Markdown mode. This should now be fixed in version 1.2.3 of the Vim editor. You can update via the Extensions menu. On web, be sure to clear your cache if the update doesn't seem to have taken effect.

@kyletolle

This comment has been minimized.

Copy link

kyletolle commented Dec 31, 2018

Thanks for the quick fix @mobitar! With Vim Editor v1.2.3 I can see the cursor again. One more question. Should the character be visible when the cursor is highlighted?

In vim itself, I see something like this:
vim cursor and character highlight
When the cursor is visible, the character gets an inverse color.

But in SN, I see this:
SN cursor highlight

When the cursor is visible in SN's vim editor, I can't see the character the cursor is on.

@kyletolle

This comment has been minimized.

Copy link

kyletolle commented Dec 31, 2018

And I'm happy to have given the detailed report. I know how providing the information upfront allows you to get right into fixing the code instead of having to follow up with me about missing information.

@kyletolle

This comment has been minimized.

Copy link

kyletolle commented Jan 2, 2019

Similarly, when I am in insert mode and double click to select text within a markdown codeblock, the background color for the highlighted text is obscured by the codeblock background color.

@mobitar

This comment has been minimized.

Copy link
Member

mobitar commented Jan 2, 2019

Hmm, good point. Have to catch up on some other stuff so won't be able to get a quick fix, but have made a note to tackle this next time I'm in this vicinity.

@kyletolle

This comment has been minimized.

Copy link

kyletolle commented Jan 8, 2019

Text highlighting also seems to be obscured when search terms are highlighted in a note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment