commit 7c26eb5

Hubert Hirtz  ·  2021-07-13 19:42:21 +0000 UTC
parent 9300574
Always update prompt
1 files changed,  +1, -10
M app.go
M app.go
+1, -10
 1@@ -115,6 +115,7 @@ func (app *App) eventLoop() {
 2 		app.handleEvents(evs)
 3 		if !app.pasting {
 4 			app.setStatus()
 5+			app.updatePrompt()
 6 			app.win.Draw()
 7 		}
 8 	}
 9@@ -311,7 +312,6 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) {
10 	if ev.Buttons() == 0 {
11 		if y == app.win.ClickedBuffer() && x < app.cfg.ChanColWidth {
12 			app.win.GoToBufferNo(y)
13-			app.updatePrompt()
14 		}
15 		app.win.ClickBuffer(-1)
16 	}
17@@ -336,7 +336,6 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) {
18 	case tcell.KeyRight:
19 		if ev.Modifiers() == tcell.ModAlt {
20 			app.win.NextBuffer()
21-			app.updatePrompt()
22 		} else if ev.Modifiers() == tcell.ModCtrl {
23 			app.win.InputRightWord()
24 		} else {
25@@ -345,7 +344,6 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) {
26 	case tcell.KeyLeft:
27 		if ev.Modifiers() == tcell.ModAlt {
28 			app.win.PreviousBuffer()
29-			app.updatePrompt()
30 		} else if ev.Modifiers() == tcell.ModCtrl {
31 			app.win.InputLeftWord()
32 		} else {
33@@ -357,14 +355,12 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) {
34 		} else {
35 			app.win.InputUp()
36 		}
37-		app.updatePrompt()
38 	case tcell.KeyDown:
39 		if ev.Modifiers() == tcell.ModAlt {
40 			app.win.NextBuffer()
41 		} else {
42 			app.win.InputDown()
43 		}
44-		app.updatePrompt()
45 	case tcell.KeyHome:
46 		if ev.Modifiers() == tcell.ModAlt {
47 			app.win.GoToBufferNo(0)
48@@ -382,19 +378,16 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) {
49 		ok := app.win.InputBackspace()
50 		if ok {
51 			app.typing()
52-			app.updatePrompt()
53 		}
54 	case tcell.KeyDelete:
55 		ok := app.win.InputDelete()
56 		if ok {
57 			app.typing()
58-			app.updatePrompt()
59 		}
60 	case tcell.KeyCtrlW:
61 		ok := app.win.InputDeleteWord()
62 		if ok {
63 			app.typing()
64-			app.updatePrompt()
65 		}
66 	case tcell.KeyTab:
67 		ok := app.win.InputAutoComplete(1)
68@@ -418,11 +411,9 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) {
69 				Body:      ui.PlainSprintf("%q: %s", input, err),
70 			})
71 		}
72-		app.updatePrompt()
73 	case tcell.KeyRune:
74 		app.win.InputRune(ev.Rune())
75 		app.typing()
76-		app.updatePrompt()
77 	default:
78 		return
79 	}