Comments (7)
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.
from citar.
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.
https://github.com/bdarcus/bibtex-actions/blob/main/bibtex-actions.el#L143-L152
If the suffix has issue of truncating too early, then it should be the issue of the function bibtex-actions--format-entry
not correctly processing ${tags:*}"
for suffix -- perhaps the asterisk is not properly interpreted? Char length 27 appears to be an outcome of 15 + 12, ignoring "*".
I could look at the runtime in edebug
if I know which commit/branch I can reproduce the issue with.
from citar.
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!
from citar.
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?
from citar.
I'd debug focusing on this part:
(truncate-string-to-width
field-value
(if (> field-width 0)
field-width
(- width (cddr format)))
The width
var is calculated in the calling function; 34% of the frame width. If * is translated to zero, perhaps (- width (cddr format)
yields an unexpected result.
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.
from citar.
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.
from citar.
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)))
from citar.
Related Issues (20)
- Expand test coverage, integrate into CI
- Using `nerd-icons` for `citar-symbols` leads to use of default values (`F`, `N`, `L`) instead HOT 2
- embark-define-keymap has been removed HOT 5
- when selecting multiple references, keep the current filter HOT 2
- Discrepancies in citation format when using `citar-insert-reference` HOT 7
- add an "other window'/"other frame" option for opening notes HOT 1
- prefixes and suffixes in `citar-markdown-insert-citation` HOT 6
- Only citation key being used for narrowing results HOT 6
- Request for Nerd Icons Integration in Citar HOT 4
- Error with inserting citation in LaTeX file: "No such file or directory tex-site" HOT 8
- Feature request: Integration with Zotra HOT 3
- Custom `C-i` bindings do not play well with `citar-open` and `RET` HOT 9
- Feature request: `citar-open-files-or-links` HOT 4
- Customizable `citar-add-file-to-library` HOT 3
- Display transform function for full names HOT 15
- Alignment doesn't work with star in template HOT 1
- Misaligned completion suggestions with company mode HOT 2
- citar--format-candidates docstring confusion
- The Homepage button on melpa leads to a 404 HOT 5
- Installing citar with guix: "Symbol's value as variable is void: citar-indicator-create" HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from citar.