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

Highlight feature "gui=strikethrough" does not display strikethrough text. #1034

Closed
jtvoorhies opened this issue Apr 4, 2020 · 5 comments · Fixed by #1287
Closed

Highlight feature "gui=strikethrough" does not display strikethrough text. #1034

jtvoorhies opened this issue Apr 4, 2020 · 5 comments · Fixed by #1287
Labels
Renderer Text rendering issues, including CoreText renderer
Milestone

Comments

@jtvoorhies
Copy link

Highlight feature "gui=strikethrough" does not display strikethrough text.

To Reproduce

  1. Run mvim --clean
  2. Create or edit an html file
  3. Type <strike>some text</strike> or :highlight htmlStrike
  4. Observe "gui=strikethrough" yet the strike mark is not on the text.

Expected behavior
The highlight feature "gui=strikethrough" should show a strikethrough

Screenshots
Screenshot attached.

Environment (please complete the following information):

  • Vim version:
    VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 3 2020 12:05:00)
    macOS version
    Included patches: 1-319
    Compiled by travis@Traviss-Mac.local
    Huge version with MacVim GUI.
  • OS: macOS 10.15.4
  • Terminal: MacVim GUI

mvim --clean no strikethrough

@ychin ychin added the Renderer Text rendering issues, including CoreText renderer label Apr 7, 2020
@ychin
Copy link
Member

ychin commented Apr 7, 2020

Yeah we should add this. Maybe next release where we look at getting the renderer fix in.

@qiqiboy
Copy link

qiqiboy commented Sep 14, 2022

Hi, is there any update on this? Thanks.

@ychin
Copy link
Member

ychin commented Sep 14, 2022

I forgot about this, that's all. I'm preparing a release right now, but let me see if it's easy to squeeze this in before the release.

Also, interestingly, Apple's terminal still doesn't support strikethrough it seems. iTerm does though, of course.

@ychin ychin added this to the Release 174 milestone Sep 14, 2022
@ychin
Copy link
Member

ychin commented Sep 14, 2022

Actually, sorry, but I think I'll push this till r175 (the one after the coming release) since I kind of want to push it out soon, and I want to make sure I get the rendering to look correct, plus support the new Vim text styles in one go (double underline, dashed / dotted underlines).

@ychin ychin modified the milestones: Release 174, Release 175 Sep 14, 2022
ychin added a commit to ychin/macvim that referenced this issue Sep 15, 2022
Add support for all the missing text styles for MacVim for Vim parity.

For strikethrough, this needed to be done as a second pass to make sure
they get drawn on top of the text. This is necessary because currently
the logic buffers texts up before dispatching them later in a line, so
it's just easier to loop through the line a second time if we detected
strikethrough. For the strikethrough position, we simply use the half of
xheight which seems to work best in looking good.

For underdouble, the logic is a little tricky because sometimes we don't
have space below the line. When that's the case, simply draw the second
line on top of the first line.

For underdotted, need to do something smart to space out the dots. When
the width is divisible by 2, they get spaced out evenly. If they are
not, try to make it work if divisible by 3. If that's not the case, we
just readjust the size of dot/gap a little bit to make it fit, even
though now we have non-integer sizes (from experimentation, the
antialising works well enough that it's not too jarring).

Also fix rendering of undercurl to work for double-width characters as
well.

Note that underdouble/underdotted/underdashed are not supported in
regular gVim yet, and so I had to add the ifdef for those in gui.c.
These may cause merge conflicts later which should be easily resolved.

Known issue 1: Note that currently underline is not respecting the
font's underline thickness and position. We always use a thickness of 1
pt, and hard-code a 0.4*descent position, which are not great. Thickness
in particular should scale with the font size. They should be fixed in a
future commit.

Known issue 2: There are some current clipping bugs in the renderer.
This is because the line height returned by NSLayoutManager is sometimes
smaller than ascent+descent+leading, *and* MMCoreTextView for some
reason takes the `ceil(descent)` (presumably to make the rendering
grid-aligned). This should be fixed later.

Fix macvim-dev#1034
@ychin
Copy link
Member

ychin commented Sep 15, 2022

Nevermind what I said. I'm waiting to see if Vim will stabilize a bit before I pick a good version to release on, so we are going to squeeze it in for the coming release r174 (#1287).

@ychin ychin modified the milestones: Release 175, Release 174 Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Renderer Text rendering issues, including CoreText renderer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants