Skip to content

Commit 689b624

Browse files
committed
Added mimicsAutoPrint for IRKernel, #933
1 parent cdeb472 commit 689b624

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎R/data.table.R‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ setPackageName("data.table",.global)
1616
# So even though .BY doesn't appear in this file, it should still be NULL here and exported because it's
1717
# defined in SDenv and can be used by users.
1818

19+
mimicsAutoPrint = c("knit_print.default")
20+
# add maybe repr_text.default. See https://github.com/Rdatatable/data.table/issues/933#issuecomment-220237965
21+
1922
print.data.table <- function(x, topn=getOption("datatable.print.topn"),
2023
nrows=getOption("datatable.print.nrows"),
2124
class=getOption("datatable.print.class"),
@@ -34,7 +37,7 @@ print.data.table <- function(x, topn=getOption("datatable.print.topn"),
3437
SYS <- sys.calls()
3538
if (length(SYS) <= 2 || # "> DT" auto-print or "> print(DT)" explicit print (cannot distinguish from R 3.2.0 but that's ok)
3639
( length(SYS) > 3L &&
37-
SYS[[length(SYS)-3L]][[1L]] == "knit_print.default") ) { # knitr auto print to mimic the prompt
40+
as.character(SYS[[length(SYS)-3L]][[1L]]) %chin% mimicsAutoPrint ) ) {
3841
.global$print = ""
3942
return(invisible())
4043
}

0 commit comments

Comments
 (0)