Skip to content

Commit

Permalink
Update size of prompt panel to fit new prompt string
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed Jan 6, 2018
1 parent 5841577 commit d6d7362
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,19 @@ func makePrompt(g *gocui.Gui) error {
inputHeight := 2
viewHeight := maxY - inputHeight

if v, err := g.SetView(Prompt, 0, viewHeight, 14, viewHeight+inputHeight); err != nil {
// Instruction View
if v, err := g.SetView(Prompt, 0, viewHeight, 19, viewHeight+inputHeight); err != nil {
if err != gocui.ErrUnknownView {
return err
}
v.Frame = false
prompt := color.Green(color.Regular, "[wasd] >>")
prompt := color.Green(color.Regular, promptString)
v.Write([]byte(prompt))
v.MoveCursor(11, 0, true)
}

if v, err := g.SetView(Input, 10, viewHeight, maxX, viewHeight+inputHeight); err != nil {
// Input View
if v, err := g.SetView(Input, 15, viewHeight, maxX, viewHeight+inputHeight); err != nil {
if err != gocui.ErrUnknownView {
return err
}
Expand Down

0 comments on commit d6d7362

Please sign in to comment.