Comparing version 0.1.8 to 0.1.9
@@ -293,2 +293,5 @@ "use strict"; | ||
const quickSelectLines = getQuickSelectLines(state.list); | ||
if (quickSelectLines.length === 0) { | ||
return line; | ||
} | ||
line += viewQuickSelectHint(quickSelectLines.length - 1, hintColumnWidth); | ||
@@ -354,5 +357,7 @@ return line; | ||
const DOWN = Buffer.from('1b5b42', 'hex'); | ||
const RIGHT = Buffer.from('1b5b43', 'hex'); | ||
const LEFT = Buffer.from('1b5b44', 'hex'); | ||
const DELETE = Buffer.from('7f', 'hex'); | ||
const BACKSPACE = Buffer.from('08', 'hex'); | ||
const ENTER = Buffer.from('0d', 'hex'); | ||
const SPACE = Buffer.from('20', 'hex'); | ||
function log(s) { | ||
@@ -602,2 +607,18 @@ fs_1.appendFileSync('./log', Buffer.from(`${JSON.stringify(s)}\n`)); | ||
} | ||
if (key.equals(RIGHT)) { | ||
if (state.searchStringCursorPosition === state.searchString.length) { | ||
return; | ||
} | ||
state.searchStringCursorPosition += 1; | ||
view(state); | ||
return; | ||
} | ||
if (key.equals(LEFT)) { | ||
if (state.searchStringCursorPosition === 0) { | ||
return; | ||
} | ||
state.searchStringCursorPosition -= 1; | ||
view(state); | ||
return; | ||
} | ||
if (key.equals(DOWN)) { | ||
@@ -608,7 +629,7 @@ state.highlightedLineIndex = Math.min(state.list.length - 1, state.highlightedLineIndex + 1); | ||
} | ||
if (key.equals(DELETE)) { | ||
if (state.searchString.length === 0) { | ||
if (key.equals(DELETE) || key.equals(BACKSPACE)) { | ||
if (state.searchStringCursorPosition === 0) { | ||
return; | ||
} | ||
state.searchString = state.searchString.slice(0, state.searchString.length - 1); | ||
state.searchString = state.searchString.substring(0, state.searchStringCursorPosition - 1) + state.searchString.substring(state.searchStringCursorPosition, state.searchString.length); | ||
state.searchStringCursorPosition -= 1; | ||
@@ -631,3 +652,3 @@ state.list = generateList(state); | ||
const inputString = key.toString(); | ||
state.searchString += inputString; | ||
state.searchString = state.searchString.substring(0, state.searchStringCursorPosition) + inputString + state.searchString.substring(state.searchStringCursorPosition, state.searchString.length); | ||
state.searchStringCursorPosition += inputString.length; | ||
@@ -634,0 +655,0 @@ state.list = generateList(state); |
{ | ||
"name": "git-jump", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Git Branches Helper", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
40157
908