Skip to content

Commit

Permalink
Merge pull request #9 from ChristianDavis/master
Browse files Browse the repository at this point in the history
clean up typos, getCols returns cols instead of rows
  • Loading branch information
AriaMinaei authored Sep 11, 2018
2 parents 1e24098 + 302a6be commit 727f1fc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/AnsiPainter.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = class AnsiPainter

_getStylesForTagName: (name) ->
unless tags[name]?
throw Error "Unkown tag name `#{name}`"
throw Error "Unknown tag name `#{name}`"

tags[name]

Expand Down
4 changes: 2 additions & 2 deletions src/ansiPainter/styles.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ styles.color = (str) ->
return '' if str is 'none'
code = codes[str]
unless code?
throw Error "Unkown color `#{str}`"
throw Error "Unknown color `#{str}`"

"\x1b[" + code + "m"

styles.bg = (str) ->
return '' if str is 'none'
code = codes['bg-' + str]
unless code?
throw Error "Unkown bg color `#{str}`"
throw Error "Unknown bg color `#{str}`"

"\x1B[" + code + "m"

Expand Down
2 changes: 1 addition & 1 deletion src/layout/block/linePrependor/Default.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = class DefaultLinePrependor extends require './_LinePrependor'
addToLeft = self.pad left
addToRight = self.pad diff - left
else
throw Error "Unkown alignment `#{alignment}`"
throw Error "Unknown alignment `#{alignment}`"
output = addToLeft + char + addToRight
else
output = self.pad @_config.amount
Expand Down
4 changes: 2 additions & 2 deletions src/renderKid/styleApplier/_common.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ module.exports = _common =
if style.color?
tagName = 'color-' + style.color
unless AnsiPainter.tags[tagName]?
throw Error "Unkown color `#{style.color}`"
throw Error "Unknown color `#{style.color}`"

tagsToAdd.push tagName

if style.background?
tagName = 'bg-' + style.background
unless AnsiPainter.tags[tagName]?
throw Error "Unkown background `#{style.background}`"
throw Error "Unknown background `#{style.background}`"

tagsToAdd.push tagName

Expand Down
2 changes: 1 addition & 1 deletion src/renderKid/styles/rule/DeclarationBlock.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = class DeclarationBlock
return Arbitrary

unless cls = declarationClasses[prop]
throw Error "Unkown property `#{prop}`. Write it as `_#{prop}` if you're defining a custom property"
throw Error "Unknown property `#{prop}`. Write it as `_#{prop}` if you're defining a custom property"

return cls

Expand Down
4 changes: 2 additions & 2 deletions src/tools.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = self =
process.stdout.getWindowSize(1)[0]
else if tty.getWindowSize
tty.getWindowSize()[1]
else if process.stdout.columns and process.stdout.rows
process.stdout.rows
else if process.stdout.columns
process.stdout.columns

if typeof cols is 'number' && cols > 30 then cols else 80

0 comments on commit 727f1fc

Please sign in to comment.