Add reopen cmd and other encodings support

This commit is contained in:
Zachary Yedidia
2019-01-23 19:06:20 -05:00
parent ef3f081347
commit ad50d7aa56
11 changed files with 78 additions and 19 deletions

View File

@@ -1,7 +1,6 @@
package display
import (
"log"
"strconv"
"unicode/utf8"
@@ -454,9 +453,7 @@ func (w *BufWindow) displayBuffer() {
}
if s, ok := config.Colorscheme["color-column"]; ok {
log.Println(vloc.X - w.gutterOffset)
if colorcolumn != 0 && vloc.X-w.gutterOffset == colorcolumn {
log.Println("display colorcolumn")
fg, _, _ := s.Decompose()
style = style.Background(fg)
}

View File

@@ -1,7 +1,6 @@
package display
import (
"log"
"unicode/utf8"
runewidth "github.com/mattn/go-runewidth"
@@ -152,10 +151,8 @@ var keydisplay = []string{"^Q Quit, ^S Save, ^O Open, ^G Help, ^E Command Bar, ^
func (i *InfoWindow) displayKeyMenu() {
// TODO: maybe make this based on the actual keybindings
log.Println("hi", len(keydisplay), i.Width)
for y := 0; y < len(keydisplay); y++ {
for x := 0; x < i.Width; x++ {
log.Println(x, i.Y-len(keydisplay)+y)
if x < len(keydisplay[y]) {
screen.Screen.SetContent(x, i.Y-len(keydisplay)+y, rune(keydisplay[y][x]), nil, config.DefStyle)
} else {

View File

@@ -30,7 +30,7 @@ type StatusLine struct {
// NewStatusLine returns a statusline bound to a window
func NewStatusLine(win *BufWindow) *StatusLine {
s := new(StatusLine)
s.FormatLeft = "$(filename) $(modified)($(line),$(col)) $(opt:filetype) $(opt:fileformat)"
s.FormatLeft = "$(filename) $(modified)($(line),$(col)) $(opt:filetype) $(opt:fileformat) $(opt:encoding)"
// s.FormatLeft = "$(filename) $(modified)(line,col) $(opt:filetype) $(opt:fileformat)"
s.FormatRight = "$(bind:ToggleKeyMenu): show bindings, $(bind:ToggleHelp): toggle help"
s.Info = map[string]func(*buffer.Buffer) string{