crsh / citr

RStudio Addin to Insert Markdown Citations
Other
407 stars 46 forks source link

Error in callFun: argument "location" is missing #76

Open ogsteele opened 3 years ago

ogsteele commented 3 years ago

Hi,

Hope you're able to help. Love the idea of the package, yet am struggling to integrate it successfully. I'm currently unable to get Citr to place any in-text citations within my Markdown documents

Citr nicely links to Zotero, sees my BetterBibTex keys and allows me to select the references of interest. However, when clicking Insert Citation I am met with the following error and no in-text citation.

Warning: Error in callFun: argument "location" is missing, with no default
  76: callFun`
  75: rstudioapi::insertText
  74: observeEventHandler
   3: shiny::runApp
   2: runGadget
   1: citr:::insert_citation
Error in execCallbacks(timeoutSecs, all, loop$id) : 
  invoke_wrapped: throwing std::runtime_error

May not be relevant, but Citr appears to correctly populate and update a references.bib file despite the lack of citation. I was obviously expecting an in-text citation and would really appreciate your help fixing this.

Installed BetterBibTex, RefManageR and bibtex this morning alongside Citr - so I'm assuming they're all up to date.

Let me know if you need any more information from me, really appreciate your time!

Cheers, Oli

rmtrane commented 3 years ago

I had a similar problem. I found a temporary solution by including location = context$selection[[1]]$range in the call to rstudioapi::insertText (see here https://github.com/crsh/citr/compare/master...rmtrane:master).

I'm not sure this is the solution, but it is a solution that has worked for me so far.

crsh commented 3 years ago

Hi Oli, which version of RStudio are you using?

Thanks, rmtrane, for chiming in. I'll take a look at your solution.

rmtrane commented 3 years ago

@crsh No, thank you for this awesome package!

Also, I'm on version 1.4.953 of RStudio.

ogsteele commented 3 years ago

Second that @rmtrane - thanks for the awesome package @crsh ! Also, thanks for the suggestion, I haven't had a chance to try and implement it but will try and get round to it in the next couple of days.

I'm on version 1.3.1073 which I think is the latest version available for OSX.