mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Merge branch 'patch-4' of git://github.com/rishiloyola/codecombat into rishiloyola-patch-4
This commit is contained in:
commit
c7eadb5670
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…
Add table
Add a link
Reference in a new issue