inst/examples/09-selectionId/server.R

library(shiny)

shinyServer(function(input, output, session) {
  output$log <- renderText({
    # note that the editor `outputId` is prepended to the name of
    # the input value for both cursor position and selection
    # i.e., use `ace_cusor` and `ace_selection` rather than
    # `cursor` and `selection`
    req(input$ace_cursor)
    paste0(
      "Cursor position: row ", input$ace_cursor$row,
      ", column ", input$ace_cursor$col,
      "\nSelection: \"", input$ace_selection, "\""
    )
  })
})

Try the shinyAce package in your browser

Any scripts or data that you put into this service are public.

shinyAce documentation built on May 6, 2022, 9:07 a.m.