Closed aciceri closed 1 year ago
Don't take too much into account what I just wrote, it's not completely clear to me both how the the offset is calculated why this doesn't work. I just found out that after splitting my frame into two equals windows (split-window-right
) I encounter this problem only in the left window:
So, it's not even true that the continuation line is empty.
Important detail: I'm on terminal and I haven't tried with graphical Emacs (I compiled it without graphic support).
This is the relevant code between terminal and graphical.
But I don't think that's relevant to the issue. 🤔
For now my solution was overriding sideline--create-ov adding a further little offset, this way I always have a useless padding on the right but it's always better than all of these annoying continuations lines.
Can you try edit sideline-format-right
? Maybe add a space on the right; from " %s"
to " %s "
. 🤔
It was the first thing I tried and I believe that in the screenshots I sent in my first message I forgot it set to " %s "
.
With " %s "
:
With " %s"
:
Further detail: I'm on Emacs 29.1
(defun my-sideline--align (&rest lengths)
"Align sideline string by LENGTHS from the right of the window."
(list (* (window-font-width)
(+ (apply #'+ lengths) (if (display-graphic-p) 1 3)))))
(advice-add 'sideline--align :override #'my-sideline--align)
Doing so seems to work even if it's not an optimal solution because the last column is not used sometimes. Said this, today I'll try it at work, if I don't face this problem anymore I can open a PR (if you want).
It was the first thing I tried and I believe that in the screenshots I sent in my first message I forgot it set to " %s ".
Thanks for testing it out! 🚀 Apparently, it does not work! 😓
Doing so seems to work even if it's not an optimal solution because the last column is not used sometimes.
Yeah, I would like to seek the ideal solution. We should figure out the reason why a new line (length too long) has been added.
I've tried it on my machine, and I cannot reproduce this. 🤔 Can you try turning on and off a few minor modes and see what could be the culprit? Or try emacs -q
and try to enable one package at a time.
Minimal steps to reproduce I found:
emacs -q
(require 'sideline)
(require 'sideline-flymake)
(setq sideline-flymake-display-mode 'line)
(setq sideline-backends-right '(sideline-flymake))
(sideline-mode +1) (flymake-mode +1)
4. `M-x eval-buffer`
5. Split the frame with `C-x 3`
6. Write something that causes an error/warning and move the cursor over
![image](https://github.com/emacs-sideline/sideline/assets/2318843/07a7b4d8-2e68-4036-b9af-682fb14945f4)
![image](https://github.com/emacs-sideline/sideline/assets/2318843/531df6ca-38d9-4d45-93b0-9d5e0a9df64c)
Hmm... still can't reproduce it. (on 29.1 as well)
My next guess is something wrong with the GUI library we are using. 🤔
Edit: I could reproduce it in the terminal! Sorry, I was dumb. 😓 I think the solution above should be sufficient in this case scenario. Can you open a PR for this? Thank you!
Ahah don't worry. PR opened :)
Hey, great package!
I'm using it with
sideline-flymake
(opening the issue here since I'm 99% this has not to do withsideline-flymake
) in order to show errors but when the buffer is sufficiently narrow (half screen is enough, no need to make it ridiculously narrow) also the sideline's continuation line is shown. Random example:The funny thing is that the continuation is even empty!
A similar thing happen when I try
Important detail: I'm on terminal and I haven't tried with graphical Emacs (I compiled it without graphic support).
For now my solution was overriding
sideline--create-ov
adding a further little offset, this way I always have a useless padding on the right but it's always better than all of these annoying continuations lines.I've tried understanding how the
sideline--create-ov
function works but it's a bit too much for me, especially at this hour.