Comparing version 0.11.2 to 0.11.3
@@ -137,3 +137,3 @@ /** | ||
var selected = this.opt.choices.where({ key : input.toLowerCase() })[0]; | ||
var selected = this.opt.choices.where({ key : input.toLowerCase().trim() })[0]; | ||
@@ -140,0 +140,0 @@ if ( selected != null && selected.key === "h" ) { |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var stripAnsi = require('strip-ansi'); | ||
var stringWidth = require('string-width'); | ||
@@ -15,6 +16,2 @@ // Prevent crashes on environments where the width can't be properly detected | ||
function width(content) { | ||
return stripAnsi(content).length; | ||
} | ||
function lastLine(content) { | ||
@@ -40,4 +37,2 @@ return _.last(content.split('\n')); | ||
ScreenManager.prototype.render = function (content, bottomContent) { | ||
var cursorPos = this.rl._getCursorPos(); | ||
this.rl.output.unmute(); | ||
@@ -62,2 +57,5 @@ this.clean(this.extraLinesUnderPrompt); | ||
// setPrompt will change cursor position, now we can get correct value | ||
var cursorPos = this.rl._getCursorPos(); | ||
content = forceLineReturn(content); | ||
@@ -89,10 +87,6 @@ if (bottomContent) { | ||
// Reset cursor at the beginning of the line | ||
util.left(this.rl, width(lastLine(fullContent))); | ||
util.left(this.rl, stringWidth(lastLine(fullContent))); | ||
// Adjust cursor on the right | ||
var rightPos = cursorPos.cols; | ||
if (cursorPos.rows === 0) { | ||
rightPos = Math.max(rightPos, width(lastLine(content))); | ||
} | ||
util.right(this.rl, rightPos); | ||
util.right(this.rl, cursorPos.cols); | ||
@@ -99,0 +93,0 @@ /** |
{ | ||
"name": "inquirer", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -34,2 +34,3 @@ "main": "lib/inquirer.js", | ||
"rx-lite": "^3.1.2", | ||
"string-width": "^1.0.1", | ||
"strip-ansi": "^3.0.0", | ||
@@ -36,0 +37,0 @@ "through": "^2.3.6" |
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
63034
13
1700
+ Addedstring-width@^1.0.1
+ Addedstring-width@1.0.2(transitive)