chore: rename EnterEditor to OpenEditor
feat: added optin to go back to the end of the saved dirs with a single key
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
Search,
|
||||
Enter,
|
||||
EnterDir,
|
||||
EnterEditor,
|
||||
OpenEditor,
|
||||
SearchRemeberDir,
|
||||
} from "../wailsjs/go/main/App.js";
|
||||
|
||||
@@ -71,6 +71,10 @@
|
||||
(search ?? []).length + (remeberSearch ?? []).length,
|
||||
);
|
||||
} else if (e.key === "ArrowUp") {
|
||||
if (selectedI === 0 && (remeberSearch ?? []).length > 0) {
|
||||
selectedI = remeberSearch.length - 1;
|
||||
return;
|
||||
}
|
||||
selectedI = Math.max(selectedI - 1, 0);
|
||||
} else if (e.key === "Enter") {
|
||||
if (selectedI < remeberSearch.length) {
|
||||
@@ -84,7 +88,7 @@
|
||||
if (selectedI < remeberSearch.length) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
EnterEditor(remeberSearch[selectedI]);
|
||||
OpenEditor(remeberSearch[selectedI]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
2
frontend/wailsjs/go/main/App.d.ts
vendored
2
frontend/wailsjs/go/main/App.d.ts
vendored
@@ -7,7 +7,7 @@ export function Enter(arg1:string):Promise<void>;
|
||||
|
||||
export function EnterDir(arg1:string):Promise<void>;
|
||||
|
||||
export function EnterEditor(arg1:string):Promise<void>;
|
||||
export function OpenEditor(arg1:string):Promise<void>;
|
||||
|
||||
export function Search(arg1:string):Promise<Array<string>>;
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ export function EnterDir(arg1) {
|
||||
return window['go']['main']['App']['EnterDir'](arg1);
|
||||
}
|
||||
|
||||
export function EnterEditor(arg1) {
|
||||
return window['go']['main']['App']['EnterEditor'](arg1);
|
||||
export function OpenEditor(arg1) {
|
||||
return window['go']['main']['App']['OpenEditor'](arg1);
|
||||
}
|
||||
|
||||
export function Search(arg1) {
|
||||
|
||||
Reference in New Issue
Block a user