Closed andreyorst closed 2 years ago
Have you tried eldoc-box-max-pixel-width
?
well, that's what I was talking about. If I set it to 600px long lines wrap character wise, while it would be better to do word wide wrapping.
вт, 24 мар. 2020 г., 19:18 Yuan Fu notifications@github.com:
Have you tried eldoc-box-max-pixel-width?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/casouri/eldoc-box/issues/28#issuecomment-603340570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUROT4ONGUI72O6R2QQOSTRJDMLTANCNFSM4LSRETAA .
Ah, I see. I would try
(add-hook 'eldoc-box-buffer-hook (lambda () (unless word-wrap (toggle-word-wrap))) nil t)
It seems it prevents eldoc box from appearing
I made a mistake, it should be
(add-hook 'eldoc-box-buffer-hook (lambda () (unless word-wrap (toggle-word-wrap))) nil t)
It doesn't make sense to add the hook locally.
However, that mistake shouldn't prevent the childframe from appearing. FWIW, I tried the snippet and it seems to work. I couldn't think of a source of your problem on top of my head.
these hooks are the same, so I think you've meant:
(add-hook 'eldoc-box-buffer-hook (lambda () (unless word-wrap (toggle-word-wrap))))
This works. Thanks!
The solution posted by @andreyorst works great for word wrapping, thank you!
Just a minor annoyance that is probably not worth opening a new issue over: the arrows that indicate wrapping are getting squished at the edges of the window. Like this:
Also consider making word wrapping the default.
Yeah I can fix that. Added to todo ; )
I pushed a change that enables visual-line-mode
in child frame, give it a try :-)
I got rid of the hook function suggested earlier and indeed we are still wrapping at word boundaries, as per visual-line-mode
. There are no more squished arrows either. Looks great to me!
More like a question, but can wrapping be enabled for eldoc-box?
I want to restrict maximum width to around 600px, an right now words are being wrapped at the middle:
I think it would be better to wrap on words, rahter than on chars:
I think this could be acheived by using visual line mode, but I don't quite get how to enable it for eldoc