mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
When pressing enter with an active selection, just make a new line under it.
This commit is contained in:
parent
bf1ef72a15
commit
75c63a0ace
1 changed files with 8 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue