Skip to content

Commit

Permalink
simplify the code printing in the verbose mode
Browse files Browse the repository at this point in the history
no longer print the `~~~ R code chunk ~~~` header or date()
  • Loading branch information
yihui committed Nov 18, 2022
1 parent 74549c4 commit 07bf3ad
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions R/parser.R
Expand Up @@ -343,13 +343,10 @@ print.block = function(x, ...) {
if (opts_knit$get('verbose')) {
code = knit_code$get(params$label)
if (length(code) && !is_blank(code)) {
cat('\n ', stringr::str_pad(' R code chunk ', getOption('width') - 10L, 'both', '~'), '\n')
cat(one_string(' ', code), '\n')
cat(' ', rep_str('~', getOption('width') - 10L), '\n')
cat('\n')
cat(one_string(' | ', code), '\n')
}
cat(paste('##------', date(), '------##'), sep = '\n')
}
cat('\n')
}

# extract inline R code fragments (as well as global options)
Expand Down

0 comments on commit 07bf3ad

Please sign in to comment.