EmilHvitfeldt/paletteer

Autocomplete adds both backticks and quotes to package and palette names

IdoBar opened this issue · 1 comments

Hi,
I love paletteer, but I found the autocomplete to behave very strangely (and unexpectedly).
When I start typing a package name in the function (say paletteer_d()), followed by tab, first it always starts showing the list of packages from the beginning (awstools::, see screenshot below), rather than using my input.
image

To get to the package I'm actually interested I then need to keep typing the next letter.
image

Then when I choose the package I'm interested to use (with enter or tab), it enters it surrounded by both backticks and quotes, which I need to edit manually.
image

Any idea why it behaves this way? I'm using the most recent CRAN version of paletteer and Rstudio (see session info below)

Thanks, Ido

Session Info:

R version 3.5.3 (2019-03-11)
Rstudio Version 1.4.1106
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252   
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] paletteer_1.3.0

loaded via a namespace (and not attached):
 [1] assertthat_0.2.1 dplyr_1.0.2      crayon_1.4.1     grid_3.5.3       R6_2.5.0        
 [6] lifecycle_1.0.0  gtable_0.3.0     magrittr_2.0.1   scales_1.1.1     ggplot2_3.3.2   
[11] pillar_1.4.6     cli_2.3.1        rlang_0.4.11     rstudioapi_0.13  generics_0.1.0  
[16] vctrs_0.3.6      ellipsis_0.3.2   rematch2_2.1.2   tools_3.5.3      glue_1.4.2      
[21] purrr_0.3.4      munsell_0.5.0    ggthemr_1.1.0    yaml_2.2.1       compiler_3.5.3  
[26] pkgconfig_2.0.3  colorspace_1.4-1 tidyselect_1.1.0 tibble_3.0.4

Hello @IdoBar, thank you for raising this issue. It appears to be an issue with RStudio that started occurring in RStudio-1.4.1717. I have made changes accordingly and it should be fixed now.

I'm not able to change the way the auto-completion works. But It not works with the quoted names as well.

library(paletteer)

paletteer_d(`"awtools::a_palette"`)
#> <colors>
#> #2A363BFF #019875FF #99B898FF #FECEA8FF #FF847CFF #E84A5FFF #C0392BFF #96281BFF

Created on 2021-07-18 by the reprex package (v2.0.0)