feat: open on the editor
This commit is contained in:
parent
8bcd4e1ab9
commit
50a46682bb
5
app.go
5
app.go
@ -190,3 +190,8 @@ func (a *App) EnterDir(value string) {
|
||||
fmt.Printf("ghostty --working-directory=%s", value)
|
||||
runtime.Quit(a.ctx)
|
||||
}
|
||||
|
||||
func (a *App) EnterEditor(value string) {
|
||||
fmt.Printf("czed %s", value)
|
||||
runtime.Quit(a.ctx)
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
Search,
|
||||
Enter,
|
||||
EnterDir,
|
||||
EnterEditor,
|
||||
SearchRemeberDir,
|
||||
} from "../wailsjs/go/main/App.js";
|
||||
|
||||
@ -79,6 +80,13 @@
|
||||
if (search[selectedI - remeberSearch.length]) {
|
||||
Enter(search[selectedI - remeberSearch.length]);
|
||||
}
|
||||
} else if (e.key === "e" && e.ctrlKey) {
|
||||
if (selectedI < remeberSearch.length) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
EnterEditor(remeberSearch[selectedI]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
2
frontend/wailsjs/go/main/App.d.ts
vendored
2
frontend/wailsjs/go/main/App.d.ts
vendored
@ -7,6 +7,8 @@ export function Enter(arg1:string):Promise<void>;
|
||||
|
||||
export function EnterDir(arg1:string):Promise<void>;
|
||||
|
||||
export function EnterEditor(arg1:string):Promise<void>;
|
||||
|
||||
export function Search(arg1:string):Promise<Array<string>>;
|
||||
|
||||
export function SearchDict(arg1:string):Promise<any>;
|
||||
|
@ -14,6 +14,10 @@ export function EnterDir(arg1) {
|
||||
return window['go']['main']['App']['EnterDir'](arg1);
|
||||
}
|
||||
|
||||
export function EnterEditor(arg1) {
|
||||
return window['go']['main']['App']['EnterEditor'](arg1);
|
||||
}
|
||||
|
||||
export function Search(arg1) {
|
||||
return window['go']['main']['App']['Search'](arg1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user