Comparing version 0.4.3 to 0.4.4
#!/usr/bin/env node | ||
const keypress = require( 'keypress' ) | ||
const fs = require( 'fs' ) | ||
@@ -6,0 +4,0 @@ const path = require( 'path' ) |
{ | ||
"name": "node-fzf", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "fzf ( junegunn/fzf ) inspired cli utility for node", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -138,2 +138,4 @@ [![npm](https://img.shields.io/npm/v/node-fzf.svg?maxAge=3600&style=flat-square)](https://www.npmjs.com/package/node-fzf) | ||
[ipt](https://github.com/ruyadorno/ipt) - similar node based solution | ||
## Test | ||
@@ -140,0 +142,0 @@ ```bash |
@@ -129,3 +129,4 @@ // used to read keyboard input while at the same time | ||
function getMaxWidth () { | ||
return clc.windowSize.width - 7 | ||
const mx = stdout.columns - 7 | ||
return Math.max( 0, mx ) | ||
} | ||
@@ -559,3 +560,3 @@ | ||
const lastMatchIndex = indexes[ indexes.length - 1 ] | ||
const marginRight = Math.ceil( clc.windowSize.width * 0.4 ) | ||
const marginRight = Math.ceil( stdout.columns * 0.4 ) | ||
@@ -621,3 +622,3 @@ let matchMarginRight = ( lastMatchIndex + marginRight ) | ||
{ | ||
const width = clc.windowSize.width | ||
const width = stdout.columns | ||
const writtenHeight = Math.max( | ||
@@ -640,4 +641,4 @@ MIN_HEIGHT, | ||
{ | ||
const width = clc.windowSize.width | ||
const height = clc.windowSize.height | ||
const width = stdout.columns || clc.windowSize.width | ||
const height = stdout.rows || clc.windowSize.height | ||
// console.log( 'window height: ' + height ) | ||
@@ -702,2 +703,3 @@ // !debug && stdout.write( clc.erase.screen ) | ||
const indexes = Object.keys( indexMap ) | ||
@@ -788,3 +790,3 @@ indexes.sort() // sort indexes | ||
// reset cursor left position | ||
stdout.write( clc.move( -clc.windowSize.width ) ) | ||
stdout.write( clc.move( -stdout.columns ) ) | ||
@@ -791,0 +793,0 @@ const cursorOffset = stringWidth( buffer.slice( 0, cursorPosition ) ) |
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
30833
144