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

Custom Block Palette: inconsistent behavior about multi-line snippets #230

Open
yanamal opened this issue Aug 8, 2016 · 1 comment
Open

Comments

@yanamal
Copy link

yanamal commented Aug 8, 2016

I was working on an online version of pencil cards, and wanted to have some multi-line snippets like:
"""
rt 45
fd 70
rt 90
fd """ (except I used \n for actual newlines and it wasn't a multiline string, i.e.: 'rt 45\nfd 70\nrt 90\nfd')

But inside the palette, only the first line shows up. I was confused, since I know there are multi-line snippets present in the regular palette. Experimentation suggests:

  1. Multi-line snippets are preserved if they represent a container statement, e.g. if, forever, functions, etc.
  2. Comments are stripped out even within those (I wanted comments like "# put useful stuff here"

Is there a way to make Pencil Code preserve my multi-line block snippets the way I want them?

@yanamal
Copy link
Author

yanamal commented Aug 8, 2016

Update: the hacky solution that more or less works is to put parenteses around the entire thing, e.g. '(rt 45\nfd 70\nrt 90\nfd)', though it still looks weird.

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

1 participant