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:
Rishi 2014-12-22 18:06:32 +05:30
parent 2bca94161e
commit 364f40274d

View file

@ -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'