Skip to content

Commit

Permalink
Merge pull request #513 from cynkra/f-488-construct_clip
Browse files Browse the repository at this point in the history
construct_clip respects non default print modes
  • Loading branch information
moodymudskipper authored Dec 31, 2024
2 parents 75788a0 + 0f59694 commit 34334fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions R/construct.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,8 @@ print.constructive <- function(

if ("clipboard" %in% print_mode) {
check_installed("clipr")
cli::cli_alert_info("Construct code has been added to the clipboard:")
cli::cli_alert_info("Code has been added to the clipboard")
clipr::write_clip(paste(x$code, collapse = "\n"), "character")
print_mode <- union(print_mode, "console")
}
if ("console" %in% print_mode) {
print(x$code)
Expand Down
2 changes: 1 addition & 1 deletion R/construct_clip.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ construct_clip <- function(
template = template,
classes = classes
)
print(out, print_mode = "clipboard")
print(out, print_mode = union("clipboard", getOption("constructive_print_mode", "console")))
}
1 change: 1 addition & 0 deletions man/constructive-package.Rd

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

0 comments on commit 34334fb

Please sign in to comment.