mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-06 07:00:24 +09:00
Use the `keymenu` option (default `off`) to enable. ToggleKeyMenu is also bound to `Alt-g` and this info is now displayed in the status line. Closes #829
21 lines
558 B
Go
21 lines
558 B
Go
package main
|
|
|
|
// DisplayKeyMenu displays the nano-style key menu at the bottom of the screen
|
|
func DisplayKeyMenu() {
|
|
w, h := screen.Size()
|
|
|
|
bot := h - 3
|
|
|
|
display := []string{"^Q Quit, ^S Save, ^O Open, ^G Help, ^E Command Bar, ^K Cut Line", "^F Find, ^Z Undo, ^Y Redo, ^A Select All, ^D Duplicate Line, ^T New Tab"}
|
|
|
|
for y := 0; y < len(display); y++ {
|
|
for x := 0; x < w; x++ {
|
|
if x < len(display[y]) {
|
|
screen.SetContent(x, bot+y, rune(display[y][x]), nil, defStyle)
|
|
} else {
|
|
screen.SetContent(x, bot+y, ' ', nil, defStyle)
|
|
}
|
|
}
|
|
}
|
|
}
|