sideline
sideline copied to clipboard
Fix right align with variable width fonts
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 use buffer-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: