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:
Andre Henriques 2025-05-24 15:38:54 +01:00
parent 50a46682bb
commit 8cef2527d6
4 changed files with 10 additions and 6 deletions

2
app.go
View File

@ -191,7 +191,7 @@ func (a *App) EnterDir(value string) {
runtime.Quit(a.ctx)
}
func (a *App) EnterEditor(value string) {
func (a *App) OpenEditor(value string) {
fmt.Printf("czed %s", value)
runtime.Quit(a.ctx)
}

View File

@ -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;
}
}

View File

@ -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>>;

View File

@ -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) {