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

Writing a newline should indent the text that follows #2

Closed
dsherret opened this issue Jan 25, 2016 · 0 comments
Closed

Writing a newline should indent the text that follows #2

dsherret opened this issue Jan 25, 2016 · 0 comments

Comments

@dsherret
Copy link
Owner

It will slow it down a bit, but doing writer.write("my string\ntest") should:

  1. Change \n or \r\n to the newline character specified when creating the writer
  2. Add the correct amount of indentation after the newline.

Essentially, it should just take the inputted string and do:

(str || "").split(/\r?\n/).forEach(s => this.writeLine(s));

Add in future maybe: a function called writeWithoutAutoIndent(str: string) for people to use to bypass this functionality?

@dsherret dsherret added this to the Version 3.0 milestone Apr 5, 2016
@dsherret dsherret changed the title Writing a newline should indent appropriately Writing a newline should indent the text that follows Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant