|
|
|
@ -487,8 +487,8 @@ func (m manager) normalMode(g *gocui.Gui, v *gocui.View) error { |
|
|
|
topBoxHeight++ // headers
|
|
|
|
topBoxHeight++ // headers
|
|
|
|
realLineLength := maxX - 2 |
|
|
|
realLineLength := maxX - 2 |
|
|
|
printedLineLength := maxX - 4 |
|
|
|
printedLineLength := maxX - 4 |
|
|
|
selectedCommand := m.s.data[m.s.highlightedItem].cmdLine |
|
|
|
statusLine := m.s.data[m.s.highlightedItem].drawStatusLine(compactRenderingMode, printedLineLength, realLineLength) |
|
|
|
var statusLineHeight int = len(selectedCommand)/(printedLineLength) + 1 |
|
|
|
var statusLineHeight int = len(statusLine) + 1 // help line
|
|
|
|
|
|
|
|
|
|
|
|
helpLineHeight := 1 |
|
|
|
helpLineHeight := 1 |
|
|
|
const helpLine = "HELP: type to search, UP/DOWN to select, RIGHT to edit, ENTER to execute, CTRL+G to abort, CTRL+C/D to quit; " + |
|
|
|
const helpLine = "HELP: type to search, UP/DOWN to select, RIGHT to edit, ENTER to execute, CTRL+G to abort, CTRL+C/D to quit; " + |
|
|
|
@ -536,29 +536,8 @@ func (m manager) normalMode(g *gocui.Gui, v *gocui.View) error { |
|
|
|
v.WriteString("\n") |
|
|
|
v.WriteString("\n") |
|
|
|
index++ |
|
|
|
index++ |
|
|
|
} |
|
|
|
} |
|
|
|
// status line
|
|
|
|
for _, line := range statusLine { |
|
|
|
var idxSt, idxEnd int |
|
|
|
v.WriteString(line) |
|
|
|
var nextLine bool |
|
|
|
|
|
|
|
tab := " " |
|
|
|
|
|
|
|
tabSize := len(tab) |
|
|
|
|
|
|
|
for idxSt < len(selectedCommand) { |
|
|
|
|
|
|
|
idxEnd = idxSt + printedLineLength |
|
|
|
|
|
|
|
if nextLine { |
|
|
|
|
|
|
|
idxEnd -= tabSize |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if idxEnd > len(selectedCommand) { |
|
|
|
|
|
|
|
idxEnd = len(selectedCommand) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
str := selectedCommand[idxSt:idxEnd] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
indent := " " |
|
|
|
|
|
|
|
if nextLine { |
|
|
|
|
|
|
|
indent += tab |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
v.WriteString(highlightStatus(rightCutPadString(indent+str, realLineLength)) + "\n") |
|
|
|
|
|
|
|
idxSt += printedLineLength |
|
|
|
|
|
|
|
nextLine = true |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
v.WriteString(helpLine) |
|
|
|
v.WriteString(helpLine) |
|
|
|
if debug { |
|
|
|
if debug { |
|
|
|
|