mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Update SpellView.coffee
hey i made changes. due to some error in downloading your data base i cannot test it. but check it . i think it will work .
This commit is contained in:
parent
2bca94161e
commit
364f40274d
1 changed files with 17 additions and 1 deletions
|
@ -215,7 +215,23 @@ module.exports = class SpellView extends CocoView
|
|||
addCommand
|
||||
name: 'disable-spaces'
|
||||
bindKey: 'Space'
|
||||
exec: => @ace.execCommand 'insertstring', ' ' unless LevelOptions[@options.level.get('slug')]?.disableSpaces
|
||||
exec: =>
|
||||
cursor = @ace.getCursorPosition()
|
||||
sentance = @aceDoc.getLine(cursor.row)
|
||||
|
||||
commentStarts =
|
||||
javascript: '//'
|
||||
python: '#'
|
||||
coffeescript: '#'
|
||||
clojure: ';'
|
||||
lua: '--'
|
||||
io: '//'
|
||||
commentStart = commentStarts[@spell.language] or '//'
|
||||
if(flg=/#{commentStart}/.test sentance)
|
||||
@ace.execCommand 'insertstring', ' '
|
||||
else
|
||||
@ace.execCommand 'insertstring', ' ' unless LevelOptions[@options.level.get('slug')]?.disableSpaces
|
||||
|
||||
addCommand
|
||||
name: 'throttle-backspaces'
|
||||
bindKey: 'Backspace'
|
||||
|
|
Loading…
Reference in a new issue