-
Notifications
You must be signed in to change notification settings - Fork 37
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
formatting issue (in terminal) #10
Comments
Hi, thanks for reporting this. The trailing spaces are used to make each line have the same length for better display. But the in terminal, the last space seems wrap into next line. Subtracting 1 of the path width seems fix the issue here. Please check after the elpa version updated. |
Thanks, this completely solves the problem I described! Now I notice a few more things that I'll mention -- not all directly about ivy-rich, and maybe not all problems. First, I show trailing whitespace, so the minibuffer has the trailing whitespace indicator on most of the lines. (I'll figure out how to turn this off just for the minibuffer.) Second, for the Recentf files (added for Issue #4), files with long path names wrap, even though the paths are abbreviated with an ellipsis, when either the first or last directory name is itself long. I'm not sure what a good solution is in this case. Perhaps abbreviating long first and last directory components with ellipses? Finally, in the example I'm looking at, there is a lot of unused whitespace between the first file-name column and the file-size column. Maybe the file-size column position could be determined dynamically so that if the |
Turning off |
Hi, thanks for addressing the issues of the package in terminal emacs. For second, I will try to find a better solution of it. For third, since the |
Yes, you're right. I reduced I don't know much about Emacs overlays and other advanced display stuff, but I will mention one other thing that may be of interest to you if you're not aware of it. I just discovered that Emacs
but whatever |
I don't know much about Emacs overlays too and I'm quite new to programming in elisp😅. I use For the issue
I've tried to modified the shorten function. Previous a path |
To make long buffer names/paths not wrap (in terminal) or visually skew otherwise nice looking columns, I use modified version of (defun madand-base/ivy-rich-switch-buffer-pad (str len &optional left)
"Improved version of `ivy-rich-switch-buffer-pad' that truncates long inputs."
(let ((real-len (length str)))
(cond
((< real-len len) (if left
(concat (make-string (- len real-len) ? ) str)
(concat str (make-string (- len real-len) ? ))))
((= len real-len) str)
(t (concat (substring str 0 (- len 1)) "…")))))
;; Override the original function using advice
(advice-add 'ivy-rich-switch-buffer-pad :override #'madand-base/ivy-rich-switch-buffer-pad) |
@madand Hi, this doesn't work if emacs window's width is small. I get
|
I use Emacs in a terminal, and I just tried ivy-rich. Each line wraps with the last trailing space extending to the next line, so that all the lines are essentially double-spaced. I'm not sure what the design considerations are, but one fix in this case would be just not to add any trailing spaces to the lines. (Another, of course, would be to add one or two fewer trailing spaces.)
I have no idea why the problem would be appearing in my case but not for everyone else. Do line lengths or line wrapping work differently for Emacs in the terminal?
The text was updated successfully, but these errors were encountered: