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

Error sidebar array separator character #134

Open
tristanlabetoulle opened this issue Jan 5, 2021 · 4 comments
Open

Error sidebar array separator character #134

tristanlabetoulle opened this issue Jan 5, 2021 · 4 comments

Comments

@tristanlabetoulle
Copy link

The settings can be changed to set the separator not to a single character but the sidebar is limited juste to one character (problem for \n for example)

@Synthoid
Copy link
Owner

Synthoid commented Jan 6, 2021

Ha, only took 24 hours for people to start experimenting with loading custom settings. The main challenge with assigning a newline char as the separator is telling the difference between the newline char \n (one char) and the string "\n" (two chars). Thinking about it while typing my comment, I may be able to switch to supporting multiple chars, basically separator strings instead of separator chars, then I can validate the input string and come up with a clever way to convert "\n" to \n (and other such char conversions like \t). I've mostly not been able to think of said solution for converting certain strings into special chars.

@OhNoxius
Copy link

OhNoxius commented Apr 7, 2021

or maybe use regex? I haven't seen your code, but maybe you can let users only type in characters in regex formatting, use JS String.replace() with a RegExp to convert all those different separators to 1 unique separator, and then use your existing code as before...

(I was just going to start a new request asking support for multiple separators, but then I saw this)

@Synthoid
Copy link
Owner

Synthoid commented Apr 7, 2021

Do you mean multiple separator chars (ie ,, |, and % simultaneously) or allow for string separators (ie %%)?

Using RegEx to validate strings is a good idea for joining escaped syntax like "\n" into single chars like \n. Though it should currently be possible for users to create something like:

Test1,
Test2,
Test3

Which would emulate having \n as the separator.

@OhNoxius
Copy link

OhNoxius commented Apr 7, 2021

ah yes smart trick to have a newline as separator (I'd have to adjust a lot of spreadsheet cells though ;)
I'm not sure what you mean exactly with your question, but I guess I mean the former: split the cell for every separator char that is encountered from a string, like ";:\n" => splits on ";" ":" and newlines

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

No branches or pull requests

3 participants