Skip to content

Commit

Permalink
🐛 Fix regression when reading tokens from line in old API
Browse files Browse the repository at this point in the history
For #343
  • Loading branch information
abe33 committed May 6, 2016
1 parent 57c3b9f commit a10def7
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/mixins/canvas-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,20 @@ export default class CanvasDrawer extends Mixin {
let tokenLines = []
if (typeof editor.tokenizedLinesForScreenRows === 'function') {
for (let tokenizedLine of editor.tokenizedLinesForScreenRows(startRow, endRow)) {
const invisibleRegExp = this.getInvisibleRegExpForLine(tokenizedLine)
tokenLines.push(tokenizedLine.tokens.map((token) => {
if (tokenizedLine) {
const invisibleRegExp = this.getInvisibleRegExpForLine(tokenizedLine)
tokenLines.push(tokenizedLine.tokens.map((token) => {
return {
value: token.value.replace(invisibleRegExp, ' '),
scopes: token.scopes.slice()
}
}))
} else {
return {
value: token.value.replace(invisibleRegExp, ' '),
scopes: token.scopes.slice()
value: '',
scopes: []
}
}))
}
}
} else {
const displayLayer = editor.displayLayer
Expand Down

0 comments on commit a10def7

Please sign in to comment.