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

[Bug] modeline is cutoff or has extra spaces at the right end depending on font size #545

Closed
3 tasks done
sdycjsj opened this issue Jun 26, 2022 · 6 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@sdycjsj
Copy link

sdycjsj commented Jun 26, 2022

Thank you for the bug report

  • I am using the latest version of doom-mode related packages.
  • I checked FAQ.
  • You may also try reproduce the issue using clean environment and minimal configurations with
    the command emacs -Q.

Bug description

If modeline font size is larger (smaller) than buffer font size, the modeline is cutoff (has extra spaces) at the right end.
It looks like the calculation of the width of the spaces in the middle is wrong.

Steps to reproduce

(set-face-attribute 'mode-line nil :height XXX) and (set-face-attribute 'mode-line-inactive nil :height XXX) to change font size.
(doom-modeline-redisplay) to refresh the modeline.
Depending on the height chosen, the right end of modeline behaves differently, as stated above.

Expected behavior

The right end of modeline should not be cutoff or have extra spaces

OS

MacOS

Emacs Version

gccemacs-28

Emacs Configurations

No response

Error callstack

No response

Anything else

No response

@sdycjsj sdycjsj added the bug Something isn't working label Jun 26, 2022
@seagle0128
Copy link
Owner

If enable doom-modeline-icon, unable to calculate the mode-line width accurately, unless all-the-icons makes all icons same size. See domtronn/all-the-icons.el#82.

@seagle0128 seagle0128 added the wontfix This will not be worked on label Jun 26, 2022
@sdycjsj
Copy link
Author

sdycjsj commented Jun 26, 2022

@seagle0128 Well, this issue has nothing to do with icons.
You can try with emacs -Q and set doom-modeline-icon to nil

@seagle0128 seagle0128 reopened this Jun 27, 2022
@seagle0128 seagle0128 removed the wontfix This will not be worked on label Jun 28, 2022
@seagle0128
Copy link
Owner

I think the calculation is accurate now. The side-effect is the performance will be impacted.

@sdycjsj
Copy link
Author

sdycjsj commented Jun 28, 2022

I think the calculation is accurate now. The side-effect is the performance will be impacted.

Thanks for the quick fix, but I cannot test it because I am using emacs 28.1 which does not have the function string-pixel-width. Was it introduced in emacs 29?

@seagle0128
Copy link
Owner

@sdycjsj Sorry for the regression issue! It has been fixed in 2ff72d7.

@sdycjsj
Copy link
Author

sdycjsj commented Jun 29, 2022

@sdycjsj Sorry for the regression issue! It has been fixed in 2ff72d7.

I can confirm that it has been fixed.
It seems compatibility takes some effort. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants