commit 713dd4a

Hubert Hirtz  ·  2020-08-05 20:03:44 +0000 UTC
parent 3bb7400
Don't request history of the home buffer
1 files changed,  +10, -10
M app.go
M app.go
+10, -10
 1@@ -161,8 +161,8 @@ func (app *App) handleUIEvent(ev tcell.Event) {
 2 			app.win.Resize()
 3 		case tcell.KeyCtrlU, tcell.KeyPgUp:
 4 			app.win.ScrollUp()
 5-			if app.win.IsAtTop() {
 6-				buffer := app.win.CurrentBuffer()
 7+			buffer := app.win.CurrentBuffer()
 8+			if app.win.IsAtTop() && buffer != ui.Home {
 9 				at := time.Now()
10 				if t := app.win.CurrentBufferOldestTime(); t != nil {
11 					at = *t
12@@ -173,8 +173,8 @@ func (app *App) handleUIEvent(ev tcell.Event) {
13 			app.win.ScrollDown()
14 		case tcell.KeyCtrlN:
15 			app.win.NextBuffer()
16-			if app.win.IsAtTop() {
17-				buffer := app.win.CurrentBuffer()
18+			buffer := app.win.CurrentBuffer()
19+			if app.win.IsAtTop() && buffer != ui.Home {
20 				at := time.Now()
21 				if t := app.win.CurrentBufferOldestTime(); t != nil {
22 					at = *t
23@@ -183,8 +183,8 @@ func (app *App) handleUIEvent(ev tcell.Event) {
24 			}
25 		case tcell.KeyCtrlP:
26 			app.win.PreviousBuffer()
27-			if app.win.IsAtTop() {
28-				buffer := app.win.CurrentBuffer()
29+			buffer := app.win.CurrentBuffer()
30+			if app.win.IsAtTop() && buffer != ui.Home {
31 				at := time.Now()
32 				if t := app.win.CurrentBufferOldestTime(); t != nil {
33 					at = *t
34@@ -194,8 +194,8 @@ func (app *App) handleUIEvent(ev tcell.Event) {
35 		case tcell.KeyRight:
36 			if ev.Modifiers() == tcell.ModAlt {
37 				app.win.NextBuffer()
38-				if app.win.IsAtTop() {
39-					buffer := app.win.CurrentBuffer()
40+				buffer := app.win.CurrentBuffer()
41+				if app.win.IsAtTop() && buffer != ui.Home {
42 					at := time.Now()
43 					if t := app.win.CurrentBufferOldestTime(); t != nil {
44 						at = *t
45@@ -208,8 +208,8 @@ func (app *App) handleUIEvent(ev tcell.Event) {
46 		case tcell.KeyLeft:
47 			if ev.Modifiers() == tcell.ModAlt {
48 				app.win.PreviousBuffer()
49-				if app.win.IsAtTop() {
50-					buffer := app.win.CurrentBuffer()
51+				buffer := app.win.CurrentBuffer()
52+				if app.win.IsAtTop() && buffer != ui.Home {
53 					at := time.Now()
54 					if t := app.win.CurrentBufferOldestTime(); t != nil {
55 						at = *t