mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Don't show indent guides for incorrect python indention.
This commit is contained in:
parent
51a37d9edc
commit
3485abd413
1 changed files with 10 additions and 3 deletions
|
@ -314,13 +314,20 @@ module.exports = class SpellView extends CocoView
|
|||
if /^\s+$/.test lines[docRange.end.row+1]
|
||||
docRange.end.row += 1
|
||||
|
||||
xstart = startOfRow(row)
|
||||
if language is 'python'
|
||||
requiredIndent = new RegExp '^' + new Array(xstart / 4 + 2).join '( |\t)' + '(\\S|\\s*$)'
|
||||
console.log requiredIndent
|
||||
for crow in [docRange.start.row+1..docRange.end.row]
|
||||
console.log("CROW", xstart, crow, lines[crow])
|
||||
unless requiredIndent.test lines[crow]
|
||||
docRange.end.row = crow - 1
|
||||
break
|
||||
|
||||
rstart = @aceSession.documentToScreenPosition docRange.start.row, docRange.start.column
|
||||
rend = @aceSession.documentToScreenPosition docRange.end.row, docRange.end.column
|
||||
range = new Range rstart.row, rstart.column, rend.row, rend.column
|
||||
|
||||
xstart = startOfRow(row)
|
||||
level = Math.floor(xstart / 4)
|
||||
indent = startOfRow(row + 1)
|
||||
color = colors[level % colors.length]
|
||||
bw = 3
|
||||
to = markerLayer.$getTop(range.start.row, config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue