-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
per-instance max-width for popup instances #29
Conversation
@@ -34,6 +34,14 @@ | |||
|
|||
;;; Utilities | |||
|
|||
|
|||
(defun calculate-max-width (width) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add popup-
prefix. Also, please remove the trailing whitespace in the next line.
Other than the minor points I mentioned on the source code:
|
… a param to popup-tip and popup-menu
Thanks for the tips! I'm not super knowledgeable about the elisp world so it's helpful to get comments. I've added a couple commits that add max-width to popup-tip and popup-menu* as well as fixing those points made in the comments. I made a separate commit for the rounding depending on whether you want the "multiple of 10" restriction or not. I thought it would make sense to enforce that when choosing a width based off of the window, but not for specific character lengths, so I left the latter case alone. |
Great work but I'm skeptical about the ratio option of By the way, I've added few comments on your commits. Please take a look. |
Thanks for catching that typo, I have no idea how that worked before! I've committed a fix. I suppose the scaling max-width is not necessary, people can just set it like you stated. I think it would be useful though. I mainly wanted this ability because I ran into issues with auto-complete and found that a large summary fills the whole screen with no space for tips: I personally want to set the max-width to a value relative to the buffer size, so I can see the tooltip regardless of how wide the buffer is: I think most people want popups to scale relative to buffer width, not to a limited number of characters. Although I could be wrong. Only corner case I can think of is the difference between 1 (1 character) and 1.0 (full width of buffer). I thought the distinction could be made clear by choosing an int or float. |
I agree with @toumorokoshi: it would be good to have popups that scale with the buffer width. I'm not that good in elisp (i.e. I just know it exists :-P) but I'd be glad to contribute in whatever way I can. |
Patch of pull request #29 cannot be merged now. I fix it for current popup.el.
@toumorokoshi I have merged Thanks for good changes. |
@syohex Thanks so much for merging this! I appreciate it, especially making a new request to make the merge easier :) |
Hi there,
I had a similar request for popup.el as #28, and I thought I'd contribute the per-instance based max-width, in a separate pull request as indicated. I also thought @laynor's addition to choosing the maximum width as ratio or character based value was cool so I added that in as well.