Don't show visual indent for comment ace things are blocks.

This commit is contained in:
Rob 2015-12-08 14:20:23 -08:00
parent 4c73112217
commit 24a43f2be8

View file

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