@@ -434,18 +434,19 @@ func (m manager) normalMode(g *gocui.Gui, v *gocui.View) error {
434
434
m .s .highlightedItem = len (m .s .data ) - 1
435
435
}
436
436
// status line
437
- topBoxSize := 3 // size of the query box up top
437
+ topBoxHeight := 3 // size of the query box up top
438
438
realLineLength := maxX - 2
439
439
printedLineLength := maxX - 4
440
440
selectedCommand := m .s .data [m .s .highlightedItem ].cmdLine
441
- var selectedLineCount int = len (selectedCommand )/ (printedLineLength ) + 1
441
+ var statusLineHeight int = len (selectedCommand )/ (printedLineLength ) + 1
442
+ statusLineHeight ++ // help line
442
443
443
- m .s .displayedItemsCount = maxY - topBoxSize - selectedLineCount
444
+ m .s .displayedItemsCount = maxY - topBoxHeight - statusLineHeight
444
445
445
446
var index int
446
447
for index < len (data ) {
447
448
itm := data [index ]
448
- if index == maxY - topBoxSize - selectedLineCount {
449
+ if index == maxY - topBoxHeight - statusLineHeight {
449
450
// page is full
450
451
break
451
452
}
@@ -471,7 +472,7 @@ func (m manager) normalMode(g *gocui.Gui, v *gocui.View) error {
471
472
index ++
472
473
}
473
474
// push the status line to the bottom of the page
474
- for index < maxY - topBoxSize - selectedLineCount {
475
+ for index < maxY - topBoxHeight - statusLineHeight {
475
476
v .WriteString ("\n " )
476
477
index ++
477
478
}
@@ -499,6 +500,7 @@ func (m manager) normalMode(g *gocui.Gui, v *gocui.View) error {
499
500
idxSt += printedLineLength
500
501
nextLine = true
501
502
}
503
+ v .WriteString ("HELP: type to search, UP/DOWN to select, RIGHT to edit, ENTER to execute, CTRL+G to abort, CTRL+C/D to quit" )
502
504
if debug {
503
505
log .Println ("len(data) =" , len (m .s .data ))
504
506
log .Println ("highlightedItem =" , m .s .highlightedItem )
0 commit comments