diff --git a/DESCRIPTION b/DESCRIPTION index 4a48088..2881cbe 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,15 +2,15 @@ Package: shinyAce Type: Package Title: Ace Editor Bindings for Shiny Version: 0.2.1 -Date: 2015-06-28 +Date: 2016-02-3 Authors@R: c( person(family="Trestle Technology, LLC", role="aut", email="cran@trestletechnology.net"), person("Jeff", "Allen", role="cre", email="cran@trestletechnology.net"), - person(family="Institut de Radioprotection et de Sûreté Nucléaire", role=c("cph"), email = "yann.richet@irsn.fr"), + person(family="Institut de Radioprotection et de Surete Nucleaire", role=c("cph"), email = "yann.richet@irsn.fr"), person(family="Ajax.org B.V.", role=c("ctb", "cph"), comment="Ace")) Description: Ace editor bindings to enable a rich text editing environment within Shiny. -License: MIT +License: MIT + file LICENSE Depends: R (>= 2.15.0) Imports: diff --git a/LICENSE b/LICENSE index 376664d..a3e5f6e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,2 @@ -The MIT License (MIT) - -Copyright (c) 2013 Jeff Allen - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +YEAR: 2016 +COPYRIGHT HOLDER: Jeff Allen, Ajax.org B.V. (Ace) \ No newline at end of file diff --git a/R/ace-autocomplete.R b/R/ace-autocomplete.R index 89037a1..c9a461e 100644 --- a/R/ace-autocomplete.R +++ b/R/ace-autocomplete.R @@ -22,8 +22,11 @@ aceAutocomplete <- function(inputId, session = shiny::getDefaultReactiveDomain() value <- session$input[[paste0("shinyAce_", inputId, "_hint")]] if(is.null(value)) return(NULL) + utilEnv <- environment(utils::alarm) + w32 <- get(".win32consoleCompletion", utilEnv) + comps <- list(id = inputId, - codeCompletions = utils:::.win32consoleCompletion(value$linebuffer, value$cursorPosition)$comps) + codeCompletions = w32(value$linebuffer, value$cursorPosition)$comps) session$sendCustomMessage('shinyAce', comps) }) diff --git a/R/ace-editor.R b/R/ace-editor.R index b73e938..3f84d49 100644 --- a/R/ace-editor.R +++ b/R/ace-editor.R @@ -10,6 +10,8 @@ #' @param theme The Ace \code{theme} to be used by the editor. The \code{theme} #' in Ace determines the styling and coloring of the editor. Use #' \code{\link{getAceThemes}} to enumerate all the themes available. +#' @param vimKeyBinding If set to \code{TRUE}, Ace will enable vim-keybindings. +#' Default value is \code{FALSE}. #' @param readOnly If set to \code{TRUE}, Ace will disable client-side editing. #' If \code{FALSE} (the default), it will enable editing. #' @param height A number (which will be interpreted as a number of pixels) or @@ -23,6 +25,8 @@ #' of every keystroke as it happens. #' @param wordWrap If set to \code{TRUE}, Ace will enable word wrapping. #' Default value is \code{FALSE}. +#' @param showLineNumbers If set to \code{TRUE}, Ace will show line numbers. +#' @param highlightActiveLine If set to \code{TRUE}, Ace will highlight the active line. #' @param cursorId The ID associated with a cursor change. #' @param selectionId The ID associated with a change of selected text #' @param hotkeys A list whose names are ID names and whose elements are the shortcuts of keys. Shortcuts can either be a simple string or a list with elements 'win' and 'mac' that that specifies different shortcuts for win and mac (see example). @@ -55,7 +59,7 @@ aceEditor <- function(outputId, value, mode, theme, vimKeyBinding = FALSE, readOnly=FALSE, height="400px", fontSize=12, debounce=1000, wordWrap=FALSE, - showLineNumbers = TRUE,highlightActiveLine=TRUE, + showLineNumbers = TRUE, highlightActiveLine=TRUE, selectionId=NULL, cursorId=NULL, hotkeys=NULL, autoComplete=c("disabled", "enabled", "live"), autoCompleteList=NULL){ diff --git a/R/update-ace-editor.R b/R/update-ace-editor.R index 765dfef..415c4e3 100644 --- a/R/update-ace-editor.R +++ b/R/update-ace-editor.R @@ -17,6 +17,7 @@ #' Should be an integer. #' @param wordWrap If set to \code{TRUE}, Ace will enable word wrapping. #' Default value is \code{FALSE}. +#' @param border Set the \code{border} 'normal', 'alert', or 'flash'. #' @param autoComplete Enable/Disable code completion. See \code{\link{aceEditor}} for details. #' @param autoCompleteList If set to \code{NULL}, exisitng static completions list will be unset. See \code{\link{aceEditor}} for details. #' @examples \dontrun{ diff --git a/README.md b/README.md index 3331121..13f400e 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Contributors (In order of first commit) --------------------------------------- - [Jeff Allen](https://github.com/trestletech) - Core project - - [Vincent Nijs](https://github.com/mostly-harmless) - Vim key bindings ([#9](https://github.com/trestletech/shinyAce/pull/9)) + - [Vincent Nijs](https://github.com/vnijs) - Vim key bindings, package maintenance ([#9](https://github.com/trestletech/shinyAce/pull/9), [#35](https://github.com/trestletech/shinyAce/pull/35)) - [Nick Carchedi](https://github.com/ncarchedi) - Word wrapping ([#12](https://github.com/trestletech/shinyAce/pull/12)) - [Sebastian Kranz](https://github.com/skranz) - Hotkey feature and cursor listener ([#16](https://github.com/trestletech/shinyAce/pull/16/files)) - [Forest Fang](https://github.com/saurfang) - Code completion ([#21](https://github.com/trestletech/shinyAce/pull/21)) diff --git a/man/aceAutocomplete.Rd b/man/aceAutocomplete.Rd index 3c9eff1..45e988b 100644 --- a/man/aceAutocomplete.Rd +++ b/man/aceAutocomplete.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/ace-autocomplete.R \name{aceAutocomplete} \alias{aceAutocomplete} diff --git a/man/aceEditor.Rd b/man/aceEditor.Rd index c6a6c89..1405bd8 100644 --- a/man/aceEditor.Rd +++ b/man/aceEditor.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/ace-editor.R \name{aceEditor} \alias{aceEditor} @@ -24,6 +24,9 @@ determines things like syntax highlighting and code folding. Use the in Ace determines the styling and coloring of the editor. Use \code{\link{getAceThemes}} to enumerate all the themes available.} +\item{vimKeyBinding}{If set to \code{TRUE}, Ace will enable vim-keybindings. +Default value is \code{FALSE}.} + \item{readOnly}{If set to \code{TRUE}, Ace will disable client-side editing. If \code{FALSE} (the default), it will enable editing.} @@ -42,6 +45,10 @@ of every keystroke as it happens.} \item{wordWrap}{If set to \code{TRUE}, Ace will enable word wrapping. Default value is \code{FALSE}.} +\item{showLineNumbers}{If set to \code{TRUE}, Ace will show line numbers.} + +\item{highlightActiveLine}{If set to \code{TRUE}, Ace will highlight the active line.} + \item{selectionId}{The ID associated with a change of selected text} \item{cursorId}{The ID associated with a cursor change.} @@ -54,7 +61,7 @@ Default value is \code{FALSE}.} \item{\code{"enabled"}}{Enable Basic Code Autocomplete. Autocomplete can be triggered using Ctrl-Space, Ctrl-Shift-Space, or Alt-Space.} \item{\code{"live"}}{Enable Live Code Autocomplete. In addition to Basic Autocomplete, it will automatically trigger at each key stroke.} } -By default, only local completer is used where all aforementioned code pieces will be considered as candidates. Use \code{autoCompleteList} for static completions and \code{\link{aceAutocomplete}} for dynamic R code compeltions.} +By default, only local completer is used where all aforementioned code pieces will be considered as candidates. Use \code{autoCompleteList} for static completions and \code{\link{aceAutocomplete}} for dynamic R code completions.} \item{autoCompleteList}{A named list that contains static code completions candidates. This can be especially useful for Non-Standard Evaluation (NSE) functions such as those in \code{dplyr} and \code{ggvis}. Each element in list should be a character array whose words will be listed under the element key. For example, to suggests column names from \code{mtcars} and \code{airquality}, you can use \code{list(mtcars = colnames(mtcars), airquality = colnames(airquality))}.} } diff --git a/man/getAceModes.Rd b/man/getAceModes.Rd index 09af8a3..8d2c73c 100644 --- a/man/getAceModes.Rd +++ b/man/getAceModes.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/get-ace-modes.R \name{getAceModes} \alias{getAceModes} diff --git a/man/getAceThemes.Rd b/man/getAceThemes.Rd index e6dd478..3575096 100644 --- a/man/getAceThemes.Rd +++ b/man/getAceThemes.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/get-ace-themes.R \name{getAceThemes} \alias{getAceThemes} diff --git a/man/jsQuote.Rd b/man/jsQuote.Rd index e789472..4b1cda3 100644 --- a/man/jsQuote.Rd +++ b/man/jsQuote.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/js-quote.R \name{jsQuote} \alias{jsQuote} diff --git a/man/updateAceEditor.Rd b/man/updateAceEditor.Rd index 9b95fd3..b6825cc 100644 --- a/man/updateAceEditor.Rd +++ b/man/updateAceEditor.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1.9000): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/update-ace-editor.R \name{updateAceEditor} \alias{updateAceEditor} @@ -33,6 +33,8 @@ Should be an integer.} \item{wordWrap}{If set to \code{TRUE}, Ace will enable word wrapping. Default value is \code{FALSE}.} +\item{border}{Set the \code{border} 'normal', 'alert', or 'flash'.} + \item{autoComplete}{Enable/Disable code completion. See \code{\link{aceEditor}} for details.} \item{autoCompleteList}{If set to \code{NULL}, exisitng static completions list will be unset. See \code{\link{aceEditor}} for details.}