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

Apply scrollback reflow patch ? #345

Open
ShellCode33 opened this issue Nov 3, 2022 · 8 comments
Open

Apply scrollback reflow patch ? #345

ShellCode33 opened this issue Nov 3, 2022 · 8 comments

Comments

@ShellCode33
Copy link

Hey, thanks for your work ! Love the custom dmenu stuff. Would you mind applying the scrollback reflow patch ?

Apply the following patch on top of the original scrollback patch (=>0.8.5) to allow column and row reflow.

Very useful when you resize windows or switch to fullscreen.

Take care

@LukeSmithxyz
Copy link
Owner

How is this any different from the current functionality?

@ShellCode33
Copy link
Author

Let's say you have a small window in which you perform a command with long lines :
image

For whatever reason you change the layout of your WM, or you resize the window, or you go fullscreen with that window.
The content's width of that window will remain the same :
image

The otherway arround is more problematic because some part of the content is not shown anymore :

image

becomes

image

Expected behavior for

image

would be to become

image

This is a poor example but you get my point. Maybe this is the behaviour you want though.

@LukeSmithxyz
Copy link
Owner

Okay. Yeah I'll try to add it, but looks like there are a bunch of little incompatibilities with other patches I or someone else will have to figure our first. I'll get to it if I can.

@ShellCode33
Copy link
Author

ShellCode33 commented Nov 15, 2022

Yep, many incompatibilities indeed. At first I was willing to submit a PR but I gave up when I saw the amount of lines in the rejected diff. Ended up doing my own fork of st, which I'm pretty sure saved me some time. Even for you I wonder if it wouldn't be faster to reapply all your patches from scratch using a clean base of st 0.9. Many of the fixes you have here on this repo are probably also fixed upstream and some others are now available as patches (such as glyph_wide_support).

Anyway, good luck to anyone reading this and willing to put in the effort

@LukeSmithxyz
Copy link
Owner

The main issue is probably getting this, boxdraw and ligatures all to work in one place. I'll try to repatch from scratch, but I think it will have to grapple with this same problem.

@ShellCode33
Copy link
Author

ShellCode33 commented Nov 16, 2022

I feel like the boxdraw patch is not worth it if you're already using a "good" font. I use Fantasque Sans Mono for my terminal, and it looks pretty much the same with and without boxdraw. At least the difference is not noticeable enough to me to add boxdraw. I added NotoSansMono as comparison, it doesn't render well indeed. It's up to you of course but for me I choose to rely on Fantasque Sans Mono instead of messing up my code even more using boxdraw. Maybe you should consider getting rid of it.

NotoSansMono font on my fork of st, without boxdraw (pretty ugly I agree) :

image

NotoSansMono font on your fork of st, with boxdraw :

image

Fantasque Sans Mono on my fork of st, without boxdraw (pretty good right?) :

image

Fantasque Sans Mono on your fork of st, with boxdraw :

image

@LukeSmithxyz
Copy link
Owner

Yeah it's not that bad. I had added boxdraw from public outcry, but if it's either or, I might go with this instead due to the wider functionality.

@speedie1337
Copy link

speedie1337 commented Nov 18, 2022

The original redraw patch that was mentioned was suggested in the st-flexipatch repository but never added because it is so massive and conflicts with a lot of patches.

There is a much smaller patch that achieves nearly the same functionality. See this patch. I have this in my own build and it works great!

Only functionality this version seems to miss is reflow for the top, but text does seem to redraw for example when you're changing mfact in dwm.

This version written by nimaipatel does not include scrollback but it can be applied on top of scrollback without issues!

The main issue is probably getting this, boxdraw and ligatures all to work in one place. I'll try to repatch from scratch, but I think it will have to grapple with this same problem.

Patch boxdraw first and apply the boxdraw version of ligatures on top.

The only difference between the original diff and the boxdraw specific diff is

diff -up a/hb.c b/hb.c
--- a/hb.c	2022-11-18 16:05:28.833868505 +0100
+++ b/hb.c	2022-11-18 16:05:56.260771013 +0100
@@ -102,6 +102,9 @@ hbtransform(XftGlyphFontSpec *specs, con
 		if (codepoints[i] != specs[specidx].glyph)
 			((Glyph *)glyphs)[i].mode |= ATTR_LIGA;
 
+		if (codepoints[i] != specs[specidx].glyph)
+			((Glyph *)glyphs)[i].mode |= ATTR_LIGA;
+
 		specs[specidx++].glyph = codepoints[i];
 	}
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants