mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
changing ace edit mode based on setting
This commit is contained in:
parent
46133ab85d
commit
ce6533de59
1 changed files with 9 additions and 4 deletions
|
@ -15,6 +15,10 @@ module.exports = class SpellView extends View
|
|||
eventsSuppressed: true
|
||||
writable: true
|
||||
|
||||
editModes:
|
||||
'javascript': 'ace/mode/javascript'
|
||||
'coffeescript': 'ace/mode/coffeescript'
|
||||
|
||||
keyBindings:
|
||||
'default': null
|
||||
'vim': 'ace/keyboard/vim'
|
||||
|
@ -67,7 +71,7 @@ module.exports = class SpellView extends View
|
|||
@aceSession = @ace.getSession()
|
||||
@aceDoc = @aceSession.getDocument()
|
||||
@aceSession.setUseWorker false
|
||||
@aceSession.setMode 'ace/mode/javascript'
|
||||
@aceSession.setMode @editModes[aceConfig.language ? 'javascript']
|
||||
@aceSession.setWrapLimitRange null
|
||||
@aceSession.setUseWrapMode true
|
||||
@aceSession.setNewLineMode "unix"
|
||||
|
@ -561,9 +565,10 @@ module.exports = class SpellView extends View
|
|||
|
||||
onChangeEditorConfig: (e) ->
|
||||
aceConfig = me.get 'aceConfig'
|
||||
@ace.setDisplayIndentGuides (aceConfig.indentGuides || false)
|
||||
@ace.setShowInvisibles (aceConfig.invisibles || false)
|
||||
@ace.setKeyboardHandler (@keyBindings[aceConfig.keyBindings] || null)
|
||||
@ace.setDisplayIndentGuides aceConfig.indentGuides # default false
|
||||
@ace.setShowInvisibles # default false
|
||||
@ace.setKeyboardHandler @keyBindings[aceConfig.keyBindings ? 'default']
|
||||
@aceSession.setMode @editModes[aceConfig.language ? 'javascript']
|
||||
|
||||
dismiss: ->
|
||||
@recompile() if @spell.hasChangedSignificantly @getSource()
|
||||
|
|
Loading…
Reference in a new issue