Skip to content

Commit

Permalink
add setGhostText
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Sep 19, 2023
1 parent 19c80c0 commit 7bcdf15
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export(selectionSet)
export(sendToConsole)
export(setCursorPosition)
export(setDocumentContents)
export(setGhostText)
export(setPersistentValue)
export(setSelectionRanges)
export(showDialog)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rstudioapi (development version)

* Added `setGhostText()` for setting ghost text in the current editor.

# rstudioapi 0.15.0

* Added `getDelegatedAzureToken` for Posit Workbench users needing to expose
Expand Down
15 changes: 15 additions & 0 deletions R/stubs.R
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,18 @@ openProject <- function(path = NULL, newSession = FALSE) {
initializeProject <- function(path = getwd()) {
callFun("initializeProject", path)
}


#' Set ghost text
#'
#' Set ghost text in the current document. The ghost text will be inserted at
#' the current cursor position. Ghost text can be inserted into the document
#' by pressing Tab, and will be automatically dismissed if the user navigates
#' the cursor away.
#'
#' @param text The ghost text to set.
#'
#' @export
setGhostText <- function(text) {
callFun("setGhostText", text)
}
4 changes: 2 additions & 2 deletions man/executeCommand.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions man/setGhostText.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7bcdf15

Please sign in to comment.