iafan / goplayspace

Advanced Go Playground frontend written in Go, with syntax highlighting, turtle graphics mode, and more
https://goplay.space
Other
981 stars 63 forks source link

Add setting to toggle auto-pairing of quote and braces #11

Closed therealplato closed 7 years ago

therealplato commented 7 years ago

The auto-pairing is painful. When I type func f(){} I end up with func f(){}}). When I type m["b"] I end up with m["b"]"]. I'm spending equal time typing code and backspacing over typos I didn't type. I recognize that some coders are accustomed to this behavior but I don't think it should default to enabled.

iafan commented 7 years ago

I agree that the quote/brace completion needs some tweaks to become useful. What currently is missing is an ability to type the closing quote/brace without duplication (the same way it is done in e.g. Sublime or VSC). When this is done, I think the completion won't get in the way (in your case you will get exactly func f(){}), so there will be no need to disable it entirely.

therealplato commented 7 years ago

That would help! We could also delete the match if adjacent. i.e. if I press the keys f("<backspace> the result would be f() with my cursor in between the braces

iafan commented 7 years ago

Yep, that's what other editors do as well. I'll look into improving this behavior.

iafan commented 7 years ago

Both features/fixes are implemented and live on https://goplay.space/ (please reload the page to make sure you're using the latest code). Let me know if this fixes your problem.

therealplato commented 7 years ago

tyvm, looks good on Windows!