lorenzwalthert / strcode

Structure your code better.
https://lorenzwalthert.github.io/strcode1/
MIT License
50 stars 6 forks source link

Coercion error in latest R version #8

Closed joseah closed 1 year ago

joseah commented 1 year ago

Dear @lorenzwalthert,

thanks for such a wonderful package! I have been using it for a few years. Recently when upgrading to R 4.3.0 the following error appears every time a try to add a break seaction:

Error in !is.null(y) && !is.na(y) : 'length = 3' in coercion to 'logical(1)'

Doing some debugging, it seems the error happens within the find_title() function, when executing:

 ui <- miniPage(miniContentPanel(fillCol(fillRow(text_focus("text1", 
    label = " ", value = "", placeholder = "Your section title", 
    width = "320px", height = "35px"), selectInput("level", 
    " ", width = "100px", choices = choices_input, selected = choices_input[level]), 
    flex = c(3, 1)), fillRow(miniTitleBarCancelButton(), 
    miniTitleBarButton("done", "Done"), checkboxInput("anchor_in_sep", 
      "Add anchor", value = options()$strcode$anchor_in_sep, 
      width = "100px"), p("Hit enter (instead of clicking Done) to confirm the title. An empty\n            field will create a separator with no title."), 
    flex = c(1, 1, 2, 3)))))

This is probably related to this and likely to come from shiny.

Cheers, Jose

lorenzwalthert commented 1 year ago

Hi @joseah, I just pushed a fix to master, can you re-install and tell me if it works again? Sorry this package is not really maintained anymore.

joseah commented 1 year ago

Hi @lorenzwalthert,

that worked like charm! Many thanks for your prompt response and again for creating this package.

Jose