Skip to content

Commit

Permalink
🐛 Fix error raised if some invisibles are undefined
Browse files Browse the repository at this point in the history
Fixes #368
  • Loading branch information
abe33 committed Jul 27, 2015
1 parent 60b5347 commit ee63370
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/mixins/canvas-drawer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,13 @@ class CanvasDrawer extends Mixin
# line - The screen line for which replacing the invisibles characters.
getInvisibleRegExp: (line) ->
if line? and line.invisibles?
///
#{_.escapeRegExp line.invisibles.cr}|
#{_.escapeRegExp line.invisibles.eol}|
#{_.escapeRegExp line.invisibles.space}|
#{_.escapeRegExp line.invisibles.tab}
///g
invisibles = []
invisibles.push line.invisibles.cr if line.invisibles.cr?
invisibles.push line.invisibles.eol if line.invisibles.eol?
invisibles.push line.invisibles.space if line.invisibles.space?
invisibles.push line.invisibles.tab if line.invisibles.tab?

///#{invisibles.map(_.escapeRegExp).join('|')}///g

# Internal: Draws a single token on the given context.
#
Expand Down

0 comments on commit ee63370

Please sign in to comment.