macvim
macvim copied to clipboard
renderer strikethrough unicode code points off-by-one
Description In MacVim 8.2.2127 (168) with Core Text Renderer on. This bug does not reproduce with Core Text Renderer off (legacy renderer on).
I believe what is happening is MacVim is displaying strikethrough unicode code points one character to the left of where they should appear, or something to that effect.
I'm using unicode control point "\u0336" for strikethrough
To Reproduce
Copy-paste and view this text in both renderers (in browser html textbox displays correctly but html preview/render appears incorrect).
this is some s̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶ text
Expected behavior
Only "strikethrough" is struck.
Actual behavior
Strike extends before the word into the space. The final letter h is unstruck.
Screenshots

Environment: MacOS Big Sur 11.0.1 (20B29), and 11.1 (20C69) MacVim 8.2.2127 (168) with Core Text Renderer on
if has("gui_macvim")
set guifont=Courier:h12
set transparency=0
set blur=20
endif
Hmm, I can't quite repro this, but I'm running on 10.15 Catalina still. I'll try to see if it repros on Big Sur for me.
Meanwhile, can you run this in terminal and paste what you options are? defaults read org.vim.MacVim | grep MM
MMAutosaveColumns = 139;
MMAutosaveRows = 72;
MMCurrentPreferencePane = Advanced;
MMOpenInCurrentWindow = 1;
MMPreloadCacheSize = 1;
MMRenderer = 1;
MMShowAddTabButton = false;
MMSuppressTerminationAlert = 1;
MMTabMinWidth = 54;
MMTabOptimumWidth = 140;
MMTopLeftPoint = "{299, 1002}";
MMUseCGLayerAlways = 1;
MMVerticalSplit = YES;
Hmm, I'm still having trouble reproducing this. To be fair I only tested 10.15 and 11.1 so not the exact same OS version as you. Can you also tell me what font you are using?
Btw, did you set MMUseCGLayerAlways to true due to a historic reason? That flag is no longer used so you could delete it by doing defaults delete org.vim.MacVim MMUseCGLayerAlways if you want.
Repros on latest Big Sur.
Added font information.
Removed MMUseCGLayerAlways.
Additional observation: when the cursor is over the leftmost struck character, the erroneous strike to the left does not appear to render.
Ok I reproduced the issue. This seems specific to the "Courier" font. I can look into it, but just some observations: This seems to me a poor interaction between macOS and Courier but I'm not sure whose fault it is. Also native rendering of the \u0336 modifier (Combining Long Stroke Overlay) in macOS or Safari seems… subpar and with lines not really lining up at the right spot (Chrome renders it fine though). Tried this in Windows and it also looks pretty bad (certain fonts in Windows also either results in the font being replaced or seeing the line show up in the character after it similar to this bug). I'm guessing this is a modifier that most font renderers don't see a lot and therefore aren't good at dealing with.
Bad interaction between the OS and the font seems like a likely culprit. It's possible the off-by-one error lives there instead of MacVim, especially since MacVim seems to render the other fonts correctly, and the OS renders some incorrectly, in the browser for instance.
Vertical unevenness in the stroke overlay is regrettable but I think a separate issue.
What I did to work around the issue for now was install the free Courier Prime and then use :set guifont=* to open the font chooser and :set guifont? to determine the magic keyword for MacVim to recognize the font. Courier Prime renders the stroke overlay perfectly as far as I can tell, including vertical evenness, and looks substantially if not exactly like Courier.