Skip to content

Keep blank REPL lines when the prompt has no trailing space - #226

Open
BetterAndBetterII wants to merge 1 commit into
executablebooks:masterfrom
BetterAndBetterII:fix/blank-repl-prompt-lines
Open

BetterAndBetterII wants to merge 1 commit into
executablebooks:masterfrom
BetterAndBetterII:fix/blank-repl-prompt-lines

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

formatCopyText only matched a prompt with its trailing space (>>> ). A blank REPL line is often just >>>, which is not empty after trim, so onlyCopyPromptLines dropped it. Copying the last docs example therefore lost the empty line between statements.

If a line does not match, retry against line + ' ' and accept that match only when the remainder is empty. That keeps the blank line and does not treat $PATH as a $ prompt.

Fixes #197

formatCopyText only matched prompts like ">>> " (trailing space), so a
bare ">>>" blank line was dropped when onlyCopyPromptLines is set.
Retry the prompt against line+" " and keep the line if the remainder
is empty, which does not treat "$PATH" as a "$ " prompt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blank Lines Stripped from code

1 participant