-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix right align with variable width fonts #21
Conversation
The only issue with this patch is the space calculation needs to be corrected. Here are the conditions we want to consider:
🤔 |
I think you got it! TBH, I don't remember how I created this since it's been a while. 😓 Can you apply the changes to this PR? Thanks! |
Yeah, this project got a little complicated. I seldom forget things I need to test. Please make sure you have sidelines on the same line (one on each side), so they don't conflict with each other. 👍 |
I finally fixed the space calculation by using @jcs090218 Could can have a check with my new commit? |
Sorry I find out that the left align fix is done by your c1729b2 @jcs090218 Should I delete the |
Does the latest commit works for you? See a462618. 🤔 |
Yes, as long as we respect the Thanks for the quick fix, I will close this PR. |
When fixing #20 , we use current window's font width to calculate the string width, but for variable width fonts, which usually used in
variable-pitch-mode
, this will cause error.Whereas emacs's built-in
string-pixel-width
do not respect the face remapping, which cause wrong string width when usebuffer-face-mode
.This pr mixed the @gustavotcabral 's patch and emac's built-in
string-pixel-width
to directly get the correct string width.This fix is not that heavy because we are doing almost the same thing as emac's built-in
string-pixel-width
.Some screenshots after fix: