When pressing enter with an active selection, just make a new line under it.

This commit is contained in:
Rob 2015-10-29 18:16:23 -04:00
parent bf1ef72a15
commit 75c63a0ace

View file

@ -75,6 +75,7 @@ module.exports = class SpellView extends CocoView
super()
@createACE()
@createACEShortcuts()
@hookACECustomBehavior()
@fillACE()
@createOnCodeChangeHandlers()
@lockDefaultCode()
@ -257,6 +258,13 @@ module.exports = class SpellView extends CocoView
@ace.remove "left"
hookACECustomBehavior: ->
@ace.commands.on 'exec', (e) =>
# When pressing enter with an active selection, just make a new line under it.
if e.command.name is 'enter-skip-delimiters'
e.editor.execCommand 'gotolineend'
return true
fillACE: ->
@ace.setValue @spell.source
@aceSession.setUndoManager(new UndoManager())