mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-01 08:23:57 -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
|
addCommand
|
||||||
name: 'disable-spaces'
|
name: 'disable-spaces'
|
||||||
bindKey: 'Space'
|
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
|
addCommand
|
||||||
name: 'throttle-backspaces'
|
name: 'throttle-backspaces'
|
||||||
bindKey: 'Backspace'
|
bindKey: 'Backspace'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue