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

Improve multiline support #10

Open
at-ng opened this issue Nov 18, 2021 · 1 comment
Open

Improve multiline support #10

at-ng opened this issue Nov 18, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@at-ng
Copy link

at-ng commented Nov 18, 2021

The way multi line works for snippets currently it seems initial white space is ignored. This can be a problem because sometimes you want to start a line with some indentation. One way to solve this would be to change this line from

data[path][snippet_key] = snippet_string

to just something like

data[path][snippet_key] = snippet_string.replace('|||', '')

Then you could start each line where you want to maintain indentation with " |||". Another option would be to do this

data[path][snippet_key] = snippet_string.replace('\\n', '\n')

Then you can maintain the indentation by doing everything on the same line, a bit more annoying to work with though but sometimes it might be better so maybe both could be supported.

@dozius dozius added the enhancement New feature or request label Dec 19, 2021
@dozius
Copy link
Owner

dozius commented Dec 19, 2021

I think the most intuitive way to handle this would be to use surrounding quotes where leading and/or trailing white space needs to be preserved. I'd gladly accept a pull request that implements general use handling of quote enclosed strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants