We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When lv-use-padding is set the hydra is meant to be centred in the free space.
This is not happening as the padding is worked out fropm the first line only - which tends to be a title and so shorter than other lines
I have altered the code to look at all the lines and calculate the padding from the longest line
(defun lv--pad-to-center (str width) "Pad STR with spaces on the left to be centered to WIDTH." (let* ((strs (split-string str "\n")) (padding (make-string (/ (- width (apply 'max (mapcar 'length strs))) 2) ?\ ))) (mapconcat (lambda (s) (concat padding s)) strs "\n")))
The text was updated successfully, but these errors were encountered:
And it needs a bit of error checking - if the frame is too small that it tries to pad -1 So better
(defun lv--pad-to-center (str width) "Pad STR with spaces on the left to be centered to WIDTH." (let* ((strs (split-string str "\n")) (padding-length (/ (- width (apply 'max (mapcar 'length strs))) 2))) (if (> padding-length 0) (mapconcat (lambda (s) (concat (make-string padding-length ?\ ) s)) strs "\n") str)))
Sorry, something went wrong.
No branches or pull requests
When lv-use-padding is set the hydra is meant to be centred in the free space.
This is not happening as the padding is worked out fropm the first line only - which tends to be a title and so shorter than other lines
I have altered the code to look at all the lines and calculate the padding from the longest line
The text was updated successfully, but these errors were encountered: