Skip to content

Commit

Permalink
don't strip trailing newlines from chunk (closes #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Nov 25, 2024
1 parent f3455dd commit 633c38d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/rstudioapi.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ stream_selection_impl <- function(selection, context, pal, n_lines_orig, remaind
stream <- pal$clone()[[".__enclos_env__"]][["private"]]$.stream(selection_text)
coro::loop(for (chunk in stream) {
if (identical(chunk, "")) {next}
output_lines <- paste(output_lines, sub("\n$", "", chunk), sep = "")
output_lines <- paste(output_lines, chunk, sep = "")
n_lines <- nchar(gsub("[^\n]+", "", output_lines)) + 1
if (n_lines_orig - n_lines > 0) {
output_padded <-
Expand Down

0 comments on commit 633c38d

Please sign in to comment.