papis / papis

Powerful and highly extensible command-line based document and bibliography manager.

Home Page:http://papis.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show diff (diff.py) in fzf

Twix53791 opened this issue · comments

commented

I worked a bit on an implementation of fzf to pickup the entries values when adding entries to the papis library.
The function difffzf is substituted to diffdict when picktool=fzf is set in config.

As I did'nt get still well the original logic of diffdict, I probably designed the fzf function a bit differently. When comparing the two dictionnaries, dictb take priority over dicta. In the fzf menu, an entry marked is ignored. All the entries not marked are saved in papis.

The only problem is than, in fzf, we can only mark or not mark entries. So to be able to completely ignore a key existing if both dicta and dictb, the fzf menu now display the two entries, in a different color. By default, the first one (dictb) will overwrite the dicta. To choose the dicta value, mark the dictb value ; to ignore the both values, mark both.

https://github.com/Twix53791/papis/tree/diff-show-in-fzf