You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to use aceEditor() to display a log file (which is continuously updated). For this I set readOnly = TRUE.
However, despite the fact that (as intended) I can't undo (CTRL + Z) the changes caused by updateAceEditor the undo stack is updated for each modification of the displayed text, which finally leads to chrome's out of memory error:
Here is an example to reproduce this behaviour (exaggerated updating rate):
library(shiny)
library(shinyAce)
ui <- fluidPage(
aceEditor(
outputId = "myeditor",
height = "82vh",
value = "",
mode = "text",
readOnly = TRUE
)
)
server <- function(input, output, session) {
log <- reactiveVal()
observe({
invalidateLater(300)
log(c(isolate(log()), paste(Sys.time(), "- This is going to pile-up in the ace.js undo stack, despite using readOnly = TRUE")))
})
observeEvent(log(), {
updateAceEditor(session, "myeditor", value = paste0(log(), collapse = "\n"))
})
}
shinyApp(ui, server)
I think it would be useful to disable the undo stack when readOnly = TRUE or updateAceEditor is used. Another option would be to provide a function to reset the undo stack.
Edit: introducing the editor option mergeUndoDeltas: true | false | 'always'; could be another approach.
The text was updated successfully, but these errors were encountered:
I'm currently trying to use
aceEditor()
to display a log file (which is continuously updated). For this I setreadOnly = TRUE
.However, despite the fact that (as intended) I can't undo (CTRL + Z) the changes caused by
updateAceEditor
the undo stack is updated for each modification of the displayed text, which finally leads to chrome's out of memory error:Here is an example to reproduce this behaviour (exaggerated updating rate):
I think it would be useful to disable the undo stack when
readOnly = TRUE
orupdateAceEditor
is used. Another option would be to provide a function to reset the undo stack.Edit: introducing the editor option mergeUndoDeltas: true | false | 'always'; could be another approach.
The text was updated successfully, but these errors were encountered: