defunkt / coffee-mode

Emacs Major Mode for CoffeeScript
http://ozmm.org/posts/coffee_mode.html
574 stars 147 forks source link

fix multiline input in coffee-send-region #316

Closed cosmicexplorer closed 9 years ago

cosmicexplorer commented 9 years ago

I'm not sure what the current coffee-send-region function is based off of; it may be an old version of coffeescript which parsed repl input differently. Either way, it fails to handle multiline input properly. This change is based off of looking over the most recent version of repl.coffee, which replaces \uFF00 with newlines to allow multiline input. After playing around with it a bit, this seems to resolve the problem. I'm not sure why the original function was made the way it was, so I may be missing something, but this seems to work.

Unfortunately, it still echoes the input and output into the *CoffeeREPL* buffer, which can be annoying for large files. I'm working on a way to avoid that.

syohex commented 9 years ago

why the original function was made the way it was

Before committing that change, we must switch to multiple line mode by sending C-v key sequence at first.