mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Merge branch 'rishiloyola-patch-4'
This commit is contained in:
commit
95f76ae9d8
1 changed files with 10 additions and 4 deletions
|
@ -215,7 +215,11 @@ module.exports = class SpellView extends CocoView
|
|||
addCommand
|
||||
name: 'disable-spaces'
|
||||
bindKey: 'Space'
|
||||
exec: => @ace.execCommand 'insertstring', ' ' unless LevelOptions[@options.level.get('slug')]?.disableSpaces
|
||||
exec: =>
|
||||
return @ace.execCommand 'insertstring', ' ' unless LevelOptions[@options.level.get('slug')]?.disableSpaces
|
||||
line = @aceDoc.getLine @ace.getCursorPosition().row
|
||||
return @ace.execCommand 'insertstring', ' ' if @singleLineCommentRegex().test line
|
||||
|
||||
addCommand
|
||||
name: 'throttle-backspaces'
|
||||
bindKey: 'Backspace'
|
||||
|
@ -781,7 +785,9 @@ module.exports = class SpellView extends CocoView
|
|||
@recompile()
|
||||
|
||||
singleLineCommentRegex: ->
|
||||
return @_singleLineCommentRegex if @_singleLineCommentRegex
|
||||
if @_singleLineCommentRegex
|
||||
@_singleLineCommentRegex.lastIndex = 0
|
||||
return @_singleLineCommentRegex
|
||||
commentStarts =
|
||||
javascript: '//'
|
||||
python: '#'
|
||||
|
@ -790,8 +796,8 @@ module.exports = class SpellView extends CocoView
|
|||
lua: '--'
|
||||
io: '//'
|
||||
commentStart = commentStarts[@spell.language] or '//'
|
||||
@_singleLineCommentRegexp ?= new RegExp "[ \t]*#{commentStart}[^\"'\n]*", 'g'
|
||||
@_singleLineCommentRegexp
|
||||
@_singleLineCommentRegex = new RegExp "[ \t]*#{commentStart}[^\"'\n]*", 'g'
|
||||
@_singleLineCommentRegex
|
||||
|
||||
preload: ->
|
||||
# Send this code over to the God for preloading, but don't change the cast state.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue