jalvesaq / zotcite

Neovim plugin for integration with Zotero
GNU General Public License v3.0
170 stars 14 forks source link

inline reference is not finding full directory #5

Closed olesendan closed 5 years ago

olesendan commented 5 years ago

Hi Jalvesaq.

Now when I'm trying to insert a reference inline, it's like zotcite cant acces the zotero database. when I do "@foo", is shows some different citation, not the one I know I have.

When I use :Zseek Zotfile can assess my zotero database.

I'm working i nvim-r enviroment = .Rmd file. my mappings for CompleteR in nvim-r is inormap "C-Space> <c-o". I've trid to set the mappings in zotfile the same, but this do not work. So I'm guessing, im doing something wrong, but can't not figure out, what it is.

Greetings from Denmark Dan Olesen

olesendan commented 5 years ago

Hi Jalvesaq.

Now I''m realising, from your last comment in issue #4 , that maybe my problems is from the following context.

I'm coming from Rstudio, and trying to adopt to neovim and nvim-r. Therefore I have .bib files in all the directories, where I have and .rmd for kniting. Besides that, in the files itself, the yaml header is calling those .bib files.

Now I thinking, that I have to delete .bib files, and remove calls to those files. Is this correct?

Greetings from denmark Dan Olesen

jalvesaq commented 5 years ago

Now I thinking, that I have to delete .bib files, and remove calls to those files. Is this correct?

Yes, you have at least to rename them, changing the file extension from .bib to something else. When you were confident that zotcite is working well you could delete the bib files.

olesendan commented 5 years ago

Hi Jalvesaq.

I can confirm, that zotcite now works in my context. Your commit to the code, is also working as expected, when I forget to remove .bib files from a directory.

Greetings from denmark Dan Olesen

olesendan commented 5 years ago

Hi Jalvesaq.

I wa to quick there. It seems there is something more coing on. The situation is now the following. I'm working on two files in the same directory. In 20_metode.Rmd no problem, zotfile opens zotero database, and will insert citation. so I enter @tjel - then c-x c-o zotcite pups up, with suggestions - choose the relevant citation - zotcite inserts it.

then I open 10_indledning.Rmd Here I enter@Tjel - then c-x c-o - then I get the following output

"20_metode.Rmd" [Modified] 159 lines --12%--
"10_indledning.Rmd" [Modified] 56 lines --57%--
Error detected while processing function CompleteR[19]..RmdNonRCompletion[21]..zotcite#CompleteBib[12]..provider#python3#Call:
line 18:
error caught in request handler 'python_eval ['ZotCite.GetMatch("tjel", "/home/dano/projects/cant-scient/speciale/opgave-speciale/paper/10_indledning.Rmd")']':
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/neovim/plugin/script_host.py", line 166, in python_eval
return eval(expr, self.module.dict)
File "", line 1, in
File "/home/dano/.config/nvim/bundle/zotcite/python3/zotero.py", line 482, in GetMatch
collections = self._d[d]
Error detected while processing function CompleteR[19]..RmdNonRCompletion[21]..zotcite#CompleteBib[12]..provider#python3#Call:
line 18:
KeyError: '/home/dano/projects/cant-scient/speciale/opgave-speciale/paper/10_indledning.Rmd'
Error detected while processing function CompleteR[19]..RmdNonRCompletion[21]..zotcite#CompleteBib:
line 13:
E714: List required

It seems that there is an issue when multiple files is open. If I only have one of the files open, then there is on problems. But with both open at the same time, I get the error.

Greetings from denmark Dan

jalvesaq commented 5 years ago

Thanks for reporting this other issue. It should be fixed now.

olesendan commented 5 years ago

Hi Jalvesaq

Your last commit, seems to have fixed this issue

Greetings from Denmark Dan