-
-
Notifications
You must be signed in to change notification settings - Fork 890
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: correct padding for lsp-modeline-progress #4438
fix: correct padding for lsp-modeline-progress #4438
Conversation
AFAIK, all packages should have space on the left, not the right. If the package (item on the right) doesn't support this, they should support it. |
01db3a4
to
e0418e7
Compare
Basically, the issue is an inconsistency with whether to pad the left or the right.
There seems to be some variance among packages but I have Minions (by Tarsius) and Minions pads the mode-line string with one space to the right and to the left: (defvar minions-mode-line-modes
(let ((recursive-edit-help-echo "Recursive edit, type C-M-c to get out"))
(list (propertize "%[" 'help-echo recursive-edit-help-echo)
'(:eval (car minions-mode-line-delimiters))
`(:propertize ("" mode-name)
help-echo "Major mode
mouse-1: Display major mode menu
mouse-2: Show help for major mode
mouse-3: Toggle minor modes"
mouse-face mode-line-highlight
local-map ,mode-line-major-mode-keymap)
'("" mode-line-process)
(propertize "%n" 'help-echo "mouse-2: Remove narrowing from buffer"
'mouse-face 'mode-line-highlight
'local-map (make-mode-line-mouse-map
'mouse-2 #'mode-line-widen))
`(:propertize ("" (:eval (minions--prominent-modes)))
mouse-face mode-line-highlight
help-echo "Minor mode
mouse-1: Display minor mode menu
mouse-2: Show help for minor mode
mouse-3: Toggle minor modes"
local-map ,mode-line-minor-mode-keymap)
'(:eval (and (not (member minions-mode-line-lighter '("" nil))) " "))
'(:eval (propertize minions-mode-line-lighter
'face minions-mode-line-face
'mouse-face 'mode-line-highlight
'help-echo "Minions
mouse-1: Display minor modes menu"
'local-map minions-mode-line-minor-modes-map))
'(:eval (cdr minions-mode-line-delimiters))
(propertize "%]" 'help-echo recursive-edit-help-echo)
" "))
"Alternative mode line construct for displaying major and minor modes.
Similar to `mode-line-modes' but instead of showing (a subset
of) the enable minor modes directly in the mode line, list all
minor modes in a space conserving menu.") and LSP's own (defun lsp-modeline--diagnostics-update-modeline ()
"Update diagnostics modeline string."
(cl-labels ((calc-modeline ()
(let ((str (lsp-modeline-diagnostics-statistics)))
(if (string-empty-p str) ""
(concat str " ")))))
(setq lsp-modeline--diagnostics-string
(cl-case lsp-modeline-diagnostics-scope
(:file (or lsp-modeline--diagnostics-string
(calc-modeline)))
(:workspace
(let ((wk (car (lsp-workspaces))))
(or (plist-get lsp-modeline--diagnostics-wks->strings wk)
(let ((ml (calc-modeline)))
(setq lsp-modeline--diagnostics-wks->strings
(plist-put lsp-modeline--diagnostics-wks->strings wk ml))
ml))))
(:global
(or (plist-get lsp-modeline--diagnostics-wks->strings :global)
(let ((ml (calc-modeline)))
(setq lsp-modeline--diagnostics-wks->strings
(plist-put lsp-modeline--diagnostics-wks->strings :global ml))
ml))))))) And it seems every other segment in |
I modified this PR to only add the one space of padding to |
@jcs090218 Hello. Currently all the other mode-line segments in |
Got it! Can you take screenshots for before and after comparisons? 🤔 Thank you! |
c0df901
to
fe86fe0
Compare
fe86fe0
to
2344e9d
Compare
Thank you! |
Hello. This PR fixes the modeline progress status squashing together with mode line item after it. The standard is that modeline items have 1 space of padding to the right.
If you think about it, this makes sense:
"item_A item_B item_C ..."
each item needs exactly 1 space of padding to the right. That way each item doesn't need to know where in the mode line order it is.