mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-28 13:50:07 -04:00
Don't show visual indent for comment ace things are blocks.
This commit is contained in:
parent
4c73112217
commit
24a43f2be8
1 changed files with 9 additions and 0 deletions
|
@ -264,6 +264,13 @@ module.exports = class SpellView extends CocoView
|
|||
|
||||
if me.level() < 20 or aceConfig.indentGuides
|
||||
# Add visual ident guides
|
||||
language = @spell.language
|
||||
ensureLineStartsBlock = (line) ->
|
||||
return false unless language is "python"
|
||||
match = /^\s*([^#]+)/.exec(line)
|
||||
return false if not match?
|
||||
return /:\s*$/.test(match[1])
|
||||
|
||||
@aceSession.addDynamicMarker
|
||||
update: (html, markerLayer, session, config) =>
|
||||
Range = ace.require('ace/range').Range
|
||||
|
@ -287,6 +294,8 @@ module.exports = class SpellView extends CocoView
|
|||
guess = startOfRow(row)
|
||||
docRange = new Range(row,guess,row,guess+4)
|
||||
|
||||
continue unless ensureLineStartsBlock(lines[row])
|
||||
|
||||
if /^\s+$/.test lines[docRange.end.row+1]
|
||||
docRange.end.row += 1
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue