terminal-kit
Advanced tools
Comparing version 2.11.5 to 2.11.6
@@ -95,2 +95,3 @@ | ||
if set, it is possible to scroll down until the bottom of the content reaches the top of the textBox | ||
* tabWidth `number` (default: 4) number of cells (=spaces) for the tab character | ||
* lineWrap `boolean` when set, the text content is wrapped to the next line instead of being clipped by the textBox border | ||
@@ -97,0 +98,0 @@ * wordWrap `boolean` like `lineWrap` but is word-aware, i.e. it doesn't split words |
@@ -50,5 +50,2 @@ /* | ||
// Hooks | ||
this.newLineAutoIndentHook = options.newLineAutoIndentHook ?? null ; | ||
if ( options.keyBindings ) { this.keyBindings = options.keyBindings ; } | ||
@@ -341,10 +338,2 @@ | ||
if ( this.newLineAutoIndentHook ) { | ||
let indentStr = this.newLineAutoIndentHook() ; | ||
if ( indentStr ) { | ||
count += this.textBuffer.insert( indentStr ) ; | ||
insertedString += indentStr ; | ||
} | ||
} | ||
if ( this.stateMachine ) { | ||
@@ -351,0 +340,0 @@ this.textBuffer.runStateMachine() ; |
@@ -76,2 +76,4 @@ /* | ||
this.tabWidth = options.tabWidth || 4 ; // How many cells (=spaces) for the tab character | ||
this.wordWrap = !! ( options.wordWrap || options.wordwrap ) ; | ||
@@ -146,2 +148,3 @@ this.lineWrap = !! ( options.lineWrap || this.wordWrap ) ; | ||
firstLineRightShift: this.firstLineRightShift , | ||
tabWidth: this.tabWidth , | ||
lineWrapWidth: this.lineWrap ? this.textAreaWidth : null , | ||
@@ -166,2 +169,3 @@ wordWrap: this.wordWrap , | ||
firstLineRightShift: this.firstLineRightShift , | ||
tabWidth: this.tabWidth , | ||
lineWrapWidth: this.lineWrap ? this.textAreaWidth : null , | ||
@@ -523,2 +527,15 @@ wordWrap: this.wordWrap , | ||
// TODOC | ||
TextBox.prototype.setTabWidth = function( tabWidth , internal = false ) { | ||
this.tabWidth = + tabWidth || 4 ; | ||
this.textBuffer.setTabWidth( this.tabWidth ) ; | ||
if ( this.altTextBuffer ) { this.altTextBuffer.setTabWidth( this.tabWidth ) ; } | ||
if ( ! internal ) { | ||
this.draw() ; | ||
} | ||
} ; | ||
// TODOC | ||
TextBox.prototype.setStateMachine = function( stateMachine , internal = false ) { | ||
@@ -525,0 +542,0 @@ this.stateMachine = stateMachine ; |
@@ -72,3 +72,3 @@ /* | ||
this.tabWidth = options.tabWidth || 4 ; | ||
this.tabWidth = + options.tabWidth || 4 ; | ||
this.forceInBound = !! options.forceInBound ; | ||
@@ -438,2 +438,19 @@ | ||
// TODOC | ||
TextBuffer.prototype.setTabWidth = function( tabWidth ) { | ||
this.tabWidth = + tabWidth || 4 ; | ||
this.reTab() ; | ||
} ; | ||
// TODOC | ||
TextBuffer.prototype.reTab = function() { | ||
for ( let y = 0 ; y < this.buffer.length ; y ++ ) { | ||
this.reTabLine( 0 , y ) ; | ||
} | ||
} ; | ||
// Recompute tabs | ||
@@ -440,0 +457,0 @@ TextBuffer.prototype.reTabLine = function( startAt = 0 , y = this.cy ) { |
{ | ||
"name": "terminal-kit", | ||
"version": "2.11.5", | ||
"version": "2.11.6", | ||
"description": "256 colors, keys and mouse, input field, progress bars, screen buffer (including 32-bit composition and image loading), text buffer, 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!", | ||
@@ -5,0 +5,0 @@ "main": "lib/termkit.js", |
@@ -49,3 +49,3 @@ #!/usr/bin/env node | ||
//var placeHolder = 're = /^some regexp (bob|bill) [a-zA-Z_-]+$/g ;\n' ; | ||
var placeHolder = 're = {\n prop: "value" ,\n key: 3\n} ;\n' ; | ||
var placeHolder = 're = {\n\tprop: "value" ,\n\tkey: 3\n} ;\n' ; | ||
//var placeHolder = '\n' ; | ||
@@ -83,2 +83,3 @@ | ||
vScrollBar: true , | ||
//tabWidth: 2 , | ||
//lineWrap: true , | ||
@@ -91,4 +92,6 @@ wordWrap: true , | ||
//setTimeout( () => textBox.setTabWidth( 8 ) , 1000 ) ; | ||
//setTimeout( () => textBox.setTabWidth( 2 ) , 2000 ) ; | ||
term.on( 'key' , function( key ) { | ||
switch( key ) { | ||
@@ -95,0 +98,0 @@ case 'CTRL_C' : |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4853379
83543