-
Notifications
You must be signed in to change notification settings - Fork 54
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
format-entry widths #67
Comments
Can you two take a look at this @jethrokuan @nobiot? If you use multiple templates in org-roam, it will have the same problem. Also, note: I made some recent performance optimizations on this code that may also be relevant for org-roam templating. |
Is this "bug" relevant for the latest commit available from MELPA? Sorry I am a bit confused about how to contribute here. By the looks of the current source code, these lines use the templates to produce a long string of text for each candidate. If the suffix has issue of truncating too early, then it should be the issue of the function I could look at the runtime in |
It's apparent in the latest MELPA release/main branch, and was introduced a few days ago. For context, I forked the bibtex-completion-format-entry function, and did not touch the logic of it. So like you, I think that's where the problem is. I'm assuming the issue is something to do with the distinction between the total width for the intended table, and the widths for each template. But not that it doesn't recognize the asterisk (I think the 0 at the end is that). TIA! |
As in, it works as expected if there is only one template/section. Bibtex-completion and its ivy and helm frontends were designed around that assumption. Maybe I need an optional "table-width" parameter on format-entry, and then somehow incorporate that into the logic? |
I'd debug focusing on this part:
The Can't debug now (working) but I'm curious ;) I'm assuming that having 2 templates is not an issue -- it may be, but it does not look to be the case so far. I might well be wrong on that, of course. |
Interestingly, if I change the widths like so, the rendering is closer to expectation. (main-width (truncate (* (frame-width) 0.65)))
(suffix-width (truncate (* (frame-width) 0.55)))) That clearly doesn't add up, because the sum is then greater than the frame-width, but the string does not extend beyond the frame. That's why I'm thinking there's a math issue. Aside: I added those lines because earlier the table was extending beyond the frame, which caused rendering problems in some completion systems. |
I opened a branch on #87 to figure this out. But yes, I think you've identified the offending section, and more specifically it's probably this line: (- width (cddr format))) |
#66 fixed one problem, but introduced another minor one.
The default suffix template has
${tags:*}
, which should extend the last column to the end.But it's truncated much earlier (if you see below, it seems like the tags are truncated at about 27 characters).
Must be because we no longer assume a single template.
Here's what I see in
ielm
:The text was updated successfully, but these errors were encountered: