m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Refactor the code to remove global variables

This commit is contained in:
Junegunn Choi
2024-05-07 16:58:17 +09:00
parent c5fb0c43f9
commit 4bedd33c59
7 changed files with 85 additions and 76 deletions

View File

@@ -86,11 +86,12 @@ func (r *Reader) terminate() {
r.mutex.Unlock()
}
func (r *Reader) restart(command string, environ []string) {
func (r *Reader) restart(command commandSpec, environ []string) {
r.event = int32(EvtReady)
r.startEventPoller()
success := r.readFromCommand(command, environ)
success := r.readFromCommand(command.command, environ)
r.fin(success)
removeFiles(command.tempFiles)
}
func (r *Reader) readChannel(inputChan chan string) bool {