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

Add the ability to reset the editor buffer back to the original "hello world" state. #323

Open
vext01 opened this issue May 8, 2018 · 9 comments
Labels
enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions!

Comments

@vext01
Copy link

vext01 commented May 8, 2018

Hi,

The rust playground remembers the last buffer you were working on. That's very useful, but sometimes I want to start afresh. I can't see a way to do this currently. Could there be a "clear" button which resets the buffer back to the default "hello world"?

Thanks

@shepmaster shepmaster added enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions! labels May 9, 2018
@shepmaster
Copy link
Member

I think this is something that can be done. A super hacky way of doing this now would be to clear your browser state for the playground, but that clears everything.

@shepmaster
Copy link
Member

If someone starts working on this, a semi-related request I've heard would be to have some "templates" of interesting pieces of code (e.g. a WASM hello world, or maybe a Futures example) to showcase pieces of the ecosystem. That's a bigger step, but might be worth keeping in the back of your mind.

@vext01
Copy link
Author

vext01 commented May 10, 2018

to have some "templates" of interesting pieces of code

sounds good to me.

You could even go as far as a vim-tutor style experience for learning Rust interactively.

But perhaps you should raise a new issue for that.

Thanks

@shepmaster
Copy link
Member

An extremely non-obvious thing you can do is to erase all the text and reload the page. This will reload the "hello world" example.

@shepmaster shepmaster changed the title Add the ability to reset (clear) the current buffer. Add the ability to reset the editor buffer back to the original "hello world state. Sep 17, 2018
@shepmaster shepmaster changed the title Add the ability to reset the editor buffer back to the original "hello world state. Add the ability to reset the editor buffer back to the original "hello world" state. Sep 17, 2018
@hdevalence
Copy link

I just tested the suggestion above, and it doesn't seem to work any more -- reloading the page just reloads the empty text now. Having an explicit "reset" button would be great!

@shepmaster
Copy link
Member

One potential enhancement: start tracking the last time someone visited. If they haven't visited in "long enough", then proactively offer to reset back to defaults.

@PaulRBerg
Copy link

I'm posting the default "Hello World" code here to make it easier for posterity to copy and paste it:

fn main() {
    println!("Hello, world!");
}

@DavidAntliff
Copy link

I attempted to use the Playground via Chrome app on iOS. I basically failed for this reason - my browser had a large example and there’s no way to select all text for mass delete. Deleting character by character is very slow (and reverts to half speed if holding delete down, for unknown reasons). In the end I couldn’t find a way to reset the playground and had to give up.

Incidentally the “hold space to move cursor” technique doesn’t work either - something about the editor window is unfriendly to iOS.

@shepmaster
Copy link
Member

For mobile users, I encourage using the simple editor:

image

Neither Ace nor Monaco work well in most mobile environments. The simple editor is just a browser-native text area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions!
Projects
None yet
Development

No branches or pull requests

5 participants