Skip to content

Commit

Permalink
Fixed bad right bitshift >> to >>>
Browse files Browse the repository at this point in the history
  • Loading branch information
cronvel committed Oct 5, 2016
1 parent 58e5ec7 commit 22c7e26
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

v0.24.30
--------

Fixed bad right bitshift >> to >>>


v0.24.28 - v0.24.29
-------------------

Expand Down
8 changes: 4 additions & 4 deletions lib/ScreenBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ ScreenBuffer.attr2object = function attr2object( attr )
var object = {} ;

object.color = attr & 255 ;
object.bgColor = ( attr >> 8 ) & 255 ;
object.bgColor = ( attr >>> 8 ) & 255 ;

// Style part
if ( attr & ScreenBuffer.BOLD ) { object.bold = true ; }
Expand Down Expand Up @@ -1049,7 +1049,7 @@ ScreenBuffer.object2attr = function object2attr( object )
ScreenBuffer.generateEscapeSequence = function generateEscapeSequence( term , attr )
{
var color = attr & 255 ;
var bgColor = ( attr >> 8 ) & 255 ;
var bgColor = ( attr >>> 8 ) & 255 ;

var esc = term.optimized.styleReset +
term.optimized.color256[ color ] +
Expand Down Expand Up @@ -1079,8 +1079,8 @@ ScreenBuffer.generateDeltaEscapeSequence = function generateDeltaEscapeSequence(
var esc = '' ,
color = attr & 255 ,
lastColor = lastAttr & 255 ,
bgColor = ( attr >> 8 ) & 255 ,
lastBgColor = ( lastAttr >> 8 ) & 255 ;
bgColor = ( attr >>> 8 ) & 255 ,
lastBgColor = ( lastAttr >>> 8 ) & 255 ;

// Bold and dim style are particular: all terminal has noBold = noDim

Expand Down
8 changes: 4 additions & 4 deletions lib/TextBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ function blitterLineIterator( p )
attr = attrs[ srcX ] ;

// Write the attributes
p.context.dstBuffer.writeUInt32BE( attr , dstOffset ) ;
p.context.dstBuffer.writeInt32BE( attr , dstOffset ) ;

charCode = str.charCodeAt( srcX ) ;

Expand All @@ -1117,7 +1117,7 @@ function blitterLineIterator( p )
for ( ; srcX <= p.srcXmax ; srcX ++ , dstOffset += ScreenBuffer.ITEM_SIZE )
{
// Write the attributes
p.context.dstBuffer.writeUInt32BE( attr , dstOffset ) ;
p.context.dstBuffer.writeInt32BE( attr , dstOffset ) ;

// Write the character
p.context.dstBuffer.write( ' ' , dstOffset + ScreenBuffer.ATTR_SIZE , ScreenBuffer.CHAR_SIZE ) ;
Expand Down Expand Up @@ -1150,7 +1150,7 @@ function blitterHiddenLineIterator( p )
attr = attrs[ srcX ] ;

// Write the attributes
p.context.dstBuffer.writeUInt32BE( attr , dstOffset ) ;
p.context.dstBuffer.writeInt32BE( attr , dstOffset ) ;

// Write the character
p.context.dstBuffer.write( char , dstOffset + ScreenBuffer.ATTR_SIZE , ScreenBuffer.CHAR_SIZE ) ;
Expand All @@ -1162,7 +1162,7 @@ function blitterHiddenLineIterator( p )
for ( ; srcX <= p.srcXmax ; srcX ++ , dstOffset += ScreenBuffer.ITEM_SIZE )
{
// Write the attributes
p.context.dstBuffer.writeUInt32BE( attr , dstOffset ) ;
p.context.dstBuffer.writeInt32BE( attr , dstOffset ) ;

// Write the character
p.context.dstBuffer.write( ' ' , dstOffset + ScreenBuffer.ATTR_SIZE , ScreenBuffer.CHAR_SIZE ) ;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "terminal-kit",
"version": "0.24.29",
"version": "0.24.30",
"description": "256 colors, keys and mouse, input field, screen buffer, interactive 'yes or no', and many more... Whether you just need colors and styles, build a simple interactive command line tool or a complexe terminal app: this is the absolute terminal lib for Node.js!",
"main": "lib/termkit.js",
"directories": {
Expand Down

0 comments on commit 22c7e26

Please sign in to comment.