parent
9ec336fcdb
commit
1b93f2232e
30
ui.go
30
ui.go
@ -244,11 +244,11 @@ func (win *win) printf(screen tcell.Screen, x, y int, st tcell.Style, format str
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (win *win) printLine(screen tcell.Screen, x, y int, st tcell.Style, s string) {
|
func (win *win) printLine(screen tcell.Screen, x, y int, st tcell.Style, s string) {
|
||||||
win.printf(screen, x, y, st, "%s%*s", s, win.w-len(s), "")
|
win.printf(screen, x, y, st, "%s%*s", s, win.w-printLength(s), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (win *win) printRight(screen tcell.Screen, y int, st tcell.Style, s string) {
|
func (win *win) printRight(screen tcell.Screen, y int, st tcell.Style, s string) {
|
||||||
win.print(screen, win.w-len(s), y, st, s)
|
win.print(screen, win.w-printLength(s), y, st, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (win *win) printReg(screen tcell.Screen, reg *reg) {
|
func (win *win) printReg(screen tcell.Screen, reg *reg) {
|
||||||
@ -729,6 +729,30 @@ func (ui *ui) drawStatLine(nav *nav) {
|
|||||||
ind := min(dir.ind+1, tot)
|
ind := min(dir.ind+1, tot)
|
||||||
acc := string(ui.keyCount) + string(ui.keyAcc)
|
acc := string(ui.keyCount) + string(ui.keyAcc)
|
||||||
|
|
||||||
|
var selection string
|
||||||
|
|
||||||
|
if len(nav.saves) > 0 {
|
||||||
|
copy := 0
|
||||||
|
move := 0
|
||||||
|
for _, cp := range nav.saves {
|
||||||
|
if cp {
|
||||||
|
copy++
|
||||||
|
} else {
|
||||||
|
move++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if copy > 0 {
|
||||||
|
selection += fmt.Sprintf(" \033[33;7m %d \033[0m", copy)
|
||||||
|
}
|
||||||
|
if move > 0 {
|
||||||
|
selection += fmt.Sprintf(" \033[31;7m %d \033[0m", move)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(nav.selections) > 0 {
|
||||||
|
selection += fmt.Sprintf(" \033[35;7m %d \033[0m", len(nav.selections))
|
||||||
|
}
|
||||||
|
|
||||||
var progress string
|
var progress string
|
||||||
|
|
||||||
if nav.copyTotal > 0 {
|
if nav.copyTotal > 0 {
|
||||||
@ -744,7 +768,7 @@ func (ui *ui) drawStatLine(nav *nav) {
|
|||||||
progress += fmt.Sprintf(" [%d/%d]", nav.deleteCount, nav.deleteTotal)
|
progress += fmt.Sprintf(" [%d/%d]", nav.deleteCount, nav.deleteTotal)
|
||||||
}
|
}
|
||||||
|
|
||||||
ruler := fmt.Sprintf("%s%s %d/%d", acc, progress, ind, tot)
|
ruler := fmt.Sprintf("%s%s%s %d/%d", acc, progress, selection, ind, tot)
|
||||||
|
|
||||||
ui.msgWin.printRight(ui.screen, 0, st, ruler)
|
ui.msgWin.printRight(ui.screen, 0, st, ruler)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user