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

RET doesn't go to a new line if form is incomplete in REPL #1422

Closed
chadhs opened this issue Nov 15, 2015 · 8 comments
Closed

RET doesn't go to a new line if form is incomplete in REPL #1422

chadhs opened this issue Nov 15, 2015 · 8 comments

Comments

@chadhs
Copy link

chadhs commented Nov 15, 2015

I'm using spacemacs and the clojure layer.

If I jack in SPC m s i
and then switch to the REPL SPC m s s
and then start writing a function that looks like this:

(defn cool-function []

and press return, I get an unbalanced parens error. screenshot: https://www.dropbox.com/s/xtu4y9c18otyntk/Screenshot%202015-11-14%2022.26.00.png?dl=0

^ j does work for entering down, but the docs say that if an expression is incomplete return should do so as well.

Let me know if you need any further info, thank you!

@chadhs
Copy link
Author

chadhs commented Nov 15, 2015

@johngit22
Copy link

Not Bad. It loo Damm Good in fact, thanks.
On Nov 14, 2015 11:32 PM, "Chad Stovern" notifications@github.com wrote:

FYI ^ j works just dandy for now:

https://www.dropbox.com/s/4o1iss9b133a9mm/Screenshot%202015-11-14%2022.29.58.png?dl=0


Reply to this email directly or view it on GitHub
#1422 (comment)
.

@Malabarba
Copy link
Member

This is because RET sends the form in the REPL, it never inserts newlines.
I guess we could have it insert newlines when the form is incomplete, as that's sort of what a regular repl does.

@bbatsov
Copy link
Member

bbatsov commented Nov 15, 2015

Yeah, probably we should do this. Should pretty simple if we just use check-parens or something like this.

@Malabarba
Copy link
Member

We already do that, it's just a matter of inserting a newline instead of complaining of the unbalance.

@chadhs
Copy link
Author

chadhs commented Nov 15, 2015

@bbatsov @Malabarba or would it make more sense to use ⇧↩, especially with smart parens strict mode enabled. thoughts?

@bbatsov
Copy link
Member

bbatsov commented Nov 15, 2015

The Shift + RET keybinding is not that common in Emacs (and we already have C-j). I'm a paredit/smartparens user and I know I'm supposed to press C-j; probably other people are aware of this as well.

@chadhs
Copy link
Author

chadhs commented Nov 15, 2015

@bbatsov 👍 yeah i agree that sounds good. thanks for all your work; CIDER is an amazing experience even for a novice Clojure tinkerer like me. ^_^

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

4 participants