Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new line at the end of continued section #1193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/line_wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ class LineWrapper extends EventEmitter {
emitLine();
}

// Add a line break in the continued section
if (options.continued === true && options.lineBreakAfter === true) {
buffer = ""
wc = 0;
textWidth = 0;
emitLine();
}

this.emit('sectionEnd', options, this);

// if the wrap is set to be continued, save the X position
Expand Down
3 changes: 2 additions & 1 deletion lib/mixins/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ export default {
if (this._textOptions) {
for (let key in this._textOptions) {
const val = this._textOptions[key];
if (key !== 'continued') {
// We don't carry over these options
if (key !== 'continued' && key !== 'lineBreakAfter') {
if (result[key] === undefined) {
result[key] = val;
}
Expand Down