]> git.lizzy.rs Git - micro.git/blob - cmd/micro/keymenu.go
Code optimisation (#1117)
[micro.git] / cmd / micro / keymenu.go
1 package main
2
3 // DisplayKeyMenu displays the nano-style key menu at the bottom of the screen
4 func DisplayKeyMenu() {
5         w, h := screen.Size()
6
7         bot := h - 3
8
9         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"}
10
11         for y := 0; y < len(display); y++ {
12                 for x := 0; x < w; x++ {
13                         if x < len(display[y]) {
14                                 screen.SetContent(x, bot+y, rune(display[y][x]), nil, defStyle)
15                         } else {
16                                 screen.SetContent(x, bot+y, ' ', nil, defStyle)
17                         }
18                 }
19         }
20 }