Adjust your cursor when it's somewhere in a header

I have checked the troubleshooting guide + searched Inkdrop to see if anyone else has asked this question.

Question:

I’ve been using Inkdrop for a couple months now, and I absolutely love it. I decided to create my own theme, so I got started using the documentation to start on a syntax theme.

I changed my cursor to a block using the following rules:

  .CodeMirror-cursor {
    // The cursor
    border: none;
    background: @sniper04 /* <- this is what I named my color */ !important;
    width: auto;
  }
  div.CodeMirror-cursors {
    z-index: 0 !important;
  }

The first rule is what actually changes it to a block-cursor, and the second rule makes it so you can still read the text your cursor is “hovering” over.

When I move my cursor to a header, however, I notice that the width is no longer effective. The height, too, is a little too big:
image

Can anyone think of a way to adjust the width of the cursor when it’s positioned within a header? I tried stringing together some .cm/.CodeMirror selectors without any success. I also couldn’t find anything in the CodeMirror documentation.

Also, Matsuyama-san, thank you so much for this app. I used to use Evernote but am so glad I switched to your app. I really respect and appreciate all your work. どうもありがとう.

Hi Connor,

Thanks for the question. The block cursor size is directly specified in CodeMirror like so:

We can’t change them from CSS. Looks like it’s by design but I don’t know how to change it.
BTW, I don’t see such an issue in my environment (macOS):

CleanShot 2022-09-26 at 13.19.02@2x

It might be something to do with your font?

Heyo! Sorry for the late reply.

I don’t think it was because of the font because I’m using default fonts, and I am also working within a macOS environment.

When I turned on the vim plugin, however, it seems to have fixed the problem. The block cursor appears and is sized to the width of every heading level. I use vim, so I’m happy with it.

Thank you again!!

Hmm weird, I guess vim plugin is nothing to do with the block cursor styles.
But good to know that it’s been resolved in your environment.