Skip to content
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

[Suggestion] Consider using a "responsive" display property for the separator in markdown-view-mode #753

Closed
casouri opened this issue Mar 5, 2023 · 5 comments

Comments

@casouri
Copy link

casouri commented Mar 5, 2023

Since eglot uses markdown-view-mode for rendering the documentation, the separator is often too long when the documentation put into a small child frame for display:

Expected Behavior

It would be nicer if the separator is "responsive": it changes width according to the viewing window's width:

Screenshot 2023-03-04 at 11 29 20 PM

Idea

We can render the separator with the display property set to (space :width text), which displays a space as long as the text portion of the window, plus a face property set to (: strike-through t), which renders a horizontal line across the whole white space.

For the code I used for the screenshot in the Expected behavior section, see casouri/eldoc-box#60

Thanks!

@syohex
Copy link
Collaborator

syohex commented Mar 6, 2023

Thank you for reporting issue. I think this is a bug in CJK language configuration. Please see #755.

And thanks for suggestion however your idea is not work if terminal or fonts don't support strike-throught characters.

@casouri
Copy link
Author

casouri commented Mar 6, 2023

The documentation text is rendered by eglot prior to be displayed by eldoc-box in a smaller window, so if the separator doesn't adjust to window width automatically, it'll always stick out.

Maybe you can implement the rendering differently based on terminal vs GUI? Strike-though don't need font support. That's your call, and feel free to close this :-)

@syohex syohex closed this as completed Mar 7, 2023
@nemethf
Copy link

nemethf commented Mar 29, 2023

Wouldn't it make sense to adapt make-separator-line of Emacs 29? That creates a horizontal line from edge to edge, and works even if the window-width changes later.

@joaotavora
Copy link

joaotavora commented Mar 30, 2023

And thanks for suggestion however your idea is not work if terminal or fonts don't support strike-throught characters.

Hey, then don't use strike-through when it's not support. Just add something that is supported and be sure to put (:extend t) in the face. It's the only place in markdown.el where window-body-width is used, and it's a shame. As soon as you resize the window or take the text for some other presentation, it breaks.

Using display with make-string for this is not the correct way to do separator lines in Emacs. Just looks at all the places where :extend t is used.

@syohex
Copy link
Collaborator

syohex commented Mar 31, 2023

I have merged #757. Please check latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants