if strings.ToLower(quit) == "yes" || strings.ToLower(quit) == "y" {
return true
} else if strings.ToLower(quit) == "save" || strings.ToLower(quit) == "s" {
- v.Save()
+ v.Save(true)
return true
}
}
if e.Modifiers() == key.modifiers {
relocate = false
for _, action := range actions {
- relocate = action(v) || relocate
+ relocate = action(v, true) || relocate
}
}
}
// Opens the given help page in a new horizontal split
func (v *View) openHelp(helpPage string) {
- helpBuffer := NewBuffer([]byte(helpPages[helpPage]), helpPage+".md")
- helpBuffer.Name = "Help"
- v.HSplit(helpBuffer)
- CurView().Help = true
+ if v.Help {
+ helpBuffer := NewBuffer([]byte(helpPages[helpPage]), helpPage+".md")
+ helpBuffer.Name = "Help"
+ v.OpenBuffer(helpBuffer)
+ } else {
+ helpBuffer := NewBuffer([]byte(helpPages[helpPage]), helpPage+".md")
+ helpBuffer.Name = "Help"
+ v.HSplit(helpBuffer)
+ CurView().Help = true
+ }
}
func (v *View) drawCell(x, y int, ch rune, combc []rune, style tcell.Style) {
}
// Now we actually draw the line
- for colN, ch := range line {
+ colN := 0
+ for _, ch := range line {
lineStyle := defStyle
if settings["syntax"].(bool) {
}
charNum = charNum.Move(1, v.Buf)
screenX++
+ colN++
}
// Here we are at a newline