Comparing version 3.0.0-1 to 3.0.0-2
@@ -40,3 +40,3 @@ "use strict"; | ||
let lineWidth = 0; | ||
if ((origin === null || origin === void 0 ? void 0 : origin.file) && (origin === null || origin === void 0 ? void 0 : origin.line)) { | ||
if ((origin === null || origin === void 0 ? void 0 : origin.file) && (origin === null || origin === void 0 ? void 0 : origin.line) && fs.existsSync(origin.file)) { | ||
const sourceCode = fs.readFileSync(origin.file, 'utf8'); | ||
@@ -43,0 +43,0 @@ excerpt = code_excerpt_1.default(sourceCode, origin.line); |
@@ -38,2 +38,10 @@ /** | ||
/** | ||
* Tab key was pressed. | ||
*/ | ||
tab: boolean; | ||
/** | ||
* Backspace key was pressed. | ||
*/ | ||
backspace: boolean; | ||
/** | ||
* [Meta key](https://en.wikipedia.org/wiki/Meta_key) was pressed. | ||
@@ -40,0 +48,0 @@ */ |
@@ -58,2 +58,4 @@ "use strict"; | ||
shift: false, | ||
tab: input === '\t' || input === '\u001B[Z', | ||
backspace: input === '\u0008', | ||
meta: false | ||
@@ -75,2 +77,9 @@ }; | ||
} | ||
// Shift+Tab | ||
if (key.tab && input === '[Z') { | ||
key.shift = true; | ||
} | ||
if (key.tab || key.backspace) { | ||
input = ''; | ||
} | ||
inputHandler(input, key); | ||
@@ -77,0 +86,0 @@ }; |
{ | ||
"name": "ink", | ||
"version": "3.0.0-1", | ||
"version": "3.0.0-2", | ||
"description": "React for CLI", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1133,2 +1133,16 @@ <h1 align="center"> | ||
###### key.tab | ||
Type: `boolean`\ | ||
Default: `false` | ||
Tab key was pressed. | ||
###### key.backspace | ||
Type: `boolean`\ | ||
Default: `false` | ||
Backspace key was pressed. | ||
###### key.meta | ||
@@ -1135,0 +1149,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
277844
3809
1723