commit cd7f0af

Galen Abell  ·  2022-02-28 13:23:32 +0000 UTC
parent 80d5d8b
Fix default highlight command path not being used
1 files changed,  +3, -3
M app.go
M app.go
+3, -3
 1@@ -970,11 +970,11 @@ func (app *App) notifyHighlight(buffer, nick, content string) {
 2 	}
 3 
 4 	netID, curBuffer := app.win.CurrentBuffer()
 5-	if _, err := os.Stat(app.cfg.OnHighlightPath); errors.Is(err, os.ErrNotExist) {
 6+	if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) {
 7 		// only error out if the user specified a highlight path
 8 		// if default path unreachable, simple bail
 9 		if app.cfg.OnHighlightPath != "" {
10-			body := fmt.Sprintf("Unable to find on-highlight command at path: %q", app.cfg.OnHighlightPath)
11+			body := fmt.Sprintf("Unable to find on-highlight command at path: %q", path)
12 			app.addStatusLine(netID, ui.Line{
13 				At:        time.Now(),
14 				Head:      "!!",
15@@ -988,7 +988,7 @@ func (app *App) notifyHighlight(buffer, nick, content string) {
16 	if buffer == curBuffer { // TODO also check netID
17 		here = "1"
18 	}
19-	cmd := exec.Command(app.cfg.OnHighlightPath)
20+	cmd := exec.Command(path)
21 	cmd.Env = append(os.Environ(),
22 		fmt.Sprintf("BUFFER=%s", buffer),
23 		fmt.Sprintf("HERE=%s", here),