brownplt / code.pyret.org

Website for serving Pyret to folks.
Other
24 stars 44 forks source link

Choose context button blindly grabs the text after the first 11 chars #511

Closed schanzer closed 4 months ago

schanzer commented 5 months ago

If you select "choose context", a dialog box appears with what CPO thinks is the existing context in an INPUT box.

But if you open an older pyret file without a context, weird things happen: image

It looks like CPO is grabbing the first line, then dropping 11 characters (just enough for use context), then putting the remaining text in the INPUT box.

I know legacy files aren't super common, but it might be worth inserting a check to ensure the line starts with use context

schanzer commented 4 months ago

Closing as a duplicate of #399