-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
patched in st-glyph-wide-support #349
base: master
Are you sure you want to change the base?
Conversation
Hi @iStagnant, does the patch actually work for you? I have just tried it and it certainly improves the situation, but doesn't really solve the issue. I'll demonstrate the behavior of wide glyphs from Neovim, with 3 terminals:
Moving forward:
Move backwards:
Losing focus while positioned on the character after wide glyph.
FYI, @Dreomite as the original author of the patch. |
Hello @Iskustvo i couldn't replicate the behaviour you are getting, when i tried it on the icons in my dwm config.h (you can try it it's in dwmrice/.config/dwm) it showed normal behaviour sure the " at the end kind of entered in the icons but that wasn't the issue this was supposed to solve. And sorry for not including visual examples i was in a hurry to test this and i can't access my laptop for the next 4 days. |
No worries, thank you for answering quick enough! Btw, are you using this repository or clean st? I also tried this branch and I don't see any difference compared to the clean Last but not least, I would really appreciate if anyone can double-check and confirm what I'm writing here. cd /tmp # Or wherever
git clone --recursive https://github.com/Iskustvo/simple_terminal.git # Download my build wrapper around st
cd simple_terminal
rm -rf patches/* # Delete all patches that I use
make get_upstream_patch LINK=https://st.suckless.org/patches/glyph_wide_support/st-glyph-wide-support-20220411-ef05519.diff # Download official patch with this fix
make -j8 # Apply downloaded patch and build st
(./st/st &> /dev/null &)& # Open newly built st
# Test behavior from above on any wide glyph symbol |
This patch is applied to this repository and not clean st.
And all of these patches fix the issue of glyphs being chopped in half, the only difference between boxdraw compatible and the non compatible ones is that if you apply any of the non compatible patches to a build of st that has boxdraw patched in weird characters appear instead of lines. Lastly i already confirmed that all these patches that derive from @Dreomite's first patch fix the issue of glyphs getting chopped in half, but i don't know about your issue, so i would like to ask you to |
You are correct, I have tested all patches you mentioned (including Regardless, thanks a lot for all the clarifications! |
Ok, so here's the thing. diff --git a/st.c b/st.c
index 62def59..cc6c78e 100644
--- a/st.c
+++ b/st.c
@@ -2640,7 +2640,8 @@ draw(void)
drawregion(0, 0, term.col, term.row);
xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
- term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
+ term.ocx, term.ocy, term.line[term.ocy][term.ocx],
+ term.line[term.ocy], term.col);
term.ocx = cx;
term.ocy = term.c.y;
xfinishdraw();
diff --git a/win.h b/win.h
index 6de960d..94679e4 100644
--- a/win.h
+++ b/win.h
@@ -25,7 +25,7 @@ enum win_mode {
void xbell(void);
void xclipcopy(void);
-void xdrawcursor(int, int, Glyph, int, int, Glyph);
+void xdrawcursor(int, int, Glyph, int, int, Glyph, Line, int);
void xdrawline(Line, int, int, int);
void xfinishdraw(void);
void xloadcols(void);
diff --git a/x.c b/x.c
index 43d1ba4..85deee6 100644
--- a/x.c
+++ b/x.c
@@ -1510,14 +1510,17 @@ xdrawglyph(Glyph g, int x, int y)
}
void
-xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
+xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og, Line line, int len)
{
Color drawcol;
/* remove the old cursor */
if (selected(ox, oy))
og.mode ^= ATTR_REVERSE;
- xdrawglyph(og, ox, oy);
+
+ /* Redraw the line where cursor was previously.
+ * It will restore wide glyphs and ligatures broken by the cursor. */
+ xdrawline(line, 0, oy, len);
if (IS_SET(MODE_HIDE))
return;
I don't know if other patches also include this redrawing part of the code, so I opened PR for official wiki to add separate patch that includes the original solution + this change above. Though I still have to figure out where to review my opened PR and potential review comments 😆 |
Unofficial patch: https://lists.suckless.org/wiki/2301/4571.html For more information, read: LukeSmithxyz/st#349
Nice job @Iskustvo! Since your solution is better i will close my PR and once you're done with everything you could open a PR here. |
No, no, you misunderstood me, sorry I wasn't clear enough! So, regarding this PR, everything is good as-is, "my" addition is only needed for standalone version of this patch, for someone who applies it on a clean Therefore, please reopen this PR, you should already be familiar with the process 😄 |
Ah ok thank you for clarifying, i will reopen the PR. |
Wide glyph truncation still occurs with the glyph-wide-support patch; see LukeSmithxyz/st#349 (comment). The code provided by LukeSmithxyz/st#349 (comment) completely fixes truncation.
Thanks to Iskustvo; see [this comment](LukeSmithxyz/st#349 (comment)).
Thank you for implementing this fix, it works fine on st 0.9 but it adds a weird border to the top and left side of the terminal window as in the screenshot Other patches I've applied: |
Fixes Glyph truncation. Patch from st site: https://st.suckless.org/patches/glyph_wide_support/