-
Notifications
You must be signed in to change notification settings - Fork 30
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
Replace (length
with (string-width
#74
base: master
Are you sure you want to change the base?
Conversation
Improve multibyte characters align
I think |
It might, but I believe that is incredibly slow if I’m not mistaken. That would be a non-starter for a modeline. |
Also, I think it’s fair to say that using a monospace font for any of these things is a requirement. We shouldn’t expect pixel perfect alignment of variable width fonts in Emacs yet. |
And |
Is is really that slow ? |
~16x slower on my machine, but still relatively fast (it takes a bit over 100 of them to get to 1ms). If there is only a few done it may not matter. I still try to avoid anything that is remotely slow in modelines because it affects typing and scrolling latency, and bad modelines have actually had material impact on my experience in Emacs. Modelines are rendered a lot, so for anything that accesses the file system, they benefit from memoization, etc.
|
16x is huge slowdown. I guess we can wait for emacs 30.0 and the |
To be clear I was just benchmarking the function in isolation, not the entire modeline. |
I vaguely remember that the right align thing doesn’t take variable fonts into account but I would have to test it. |
Improve multibyte characters align.
Ref: #72