elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

Allow inserting newline with Shift-Enter #148

Open Ryan1729 opened 7 years ago

Ryan1729 commented 7 years ago

I'd like to be able to produce a function definition like the following from the readme by pressing <Shift+Enter> where I would otherwise have to press \ then Enter.

factorial n = \
   if n < 1 then 1 \
            else n * factorial (n-1)

It would be even better if leading whitespace could be inserted automatically. A reasonable approximation to parsing partial expressions could be to insert the same amount of whitespace as the previous line had, unless there is none, in which case some standard amount of whitespace should be added.

REPLs for several other languages have this feature as you can see here, including whitespace significant languages like python3.

Elm version 0.18 Ubuntu 16.04 LTS node v6.9.1

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.