Commit 12e8d93b authored by Thomas Friedrichsmeier's avatar Thomas Friedrichsmeier
Browse files

Fix help search.

Thanks to Stefan for reporting!
parent 3152e5ec
- Fixed: Help Search was not longer working correctly with recent version of R TODO: which version?
- Fix compilation with R 3.3.x
- Provide better status feedback when searching / filtering among installable packages
- Add access to basic menu items for docked previews
- Move preview controls to the button-column of dialogs TODO document, polish
......@@ -12,7 +14,7 @@
- File selectors in "Import XYZ" plugins now filter for standard file extensions, by default
- Add previews for CSV, SPSS, and Stata import plugins
- Allow previews for data, (HTML) output, and custom types of previews
- Allow previews to be docked to the dialog window, add dock them, by default TODO: update documentation on placemnet
- Allow previews to be docked to the dialog window, and dock them, by default TODO: update documentation on placemnet
- Implicitly save code preview visibility and size (instead of the former explicit settings)
- data.frame objects outside of globalenv() can be opened read-only in an editor window
- Show a warning screen when invoking plugins from the command line (or from clicking an rkward://-link in an external application)
......
......@@ -40,8 +40,14 @@
# Simple wrapper around help.search. Concatenates the relevant fields of the results in order for passing to the frontend.
#' @export
".rk.get.search.results" <- function (pattern, ...) {
H=as.data.frame (help.search(pattern, ...)$matches)
# NOTE: The field "Type" was added in R 2.14.0. For earlier versions of R, only help pages were returned as results of help.search()
if ((dim (H)[1] > 0) && (is.null (H$Type))) H$Type <- "help"
c (as.character (H$topic), as.character (H$title), as.character(H$Package), as.character(H$Type))
H = as.data.frame(help.search(pattern, ...)$matches)
fields <- names (H)
c(
# NOTE: Field header capitalization appears to have changed in some version of R around 3.2.x
as.character (if ("topic" %in% fields) H$topic else H$Topic),
as.character (if ("title" %in% fields) H$title else H$Title),
as.character (if ("package" %in% fields) H$package else H$Package),
# NOTE: The field "Type" was added in R 2.14.0. For earlier versions of R, only help pages were returned as results of help.search()
as.character (if ("Type" %in% fields) H$Type else rep ("help", length.out=dim(H)[1]))
)
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment