Commit 799aa988 authored by Josh Yan's avatar Josh Yan
Browse files

go fmt'd cmd.go

parent c9e584fb
...@@ -744,9 +744,9 @@ func displayResponse(content string, wordWrap bool, state *displayResponseState) ...@@ -744,9 +744,9 @@ func displayResponse(content string, wordWrap bool, state *displayResponseState)
termWidth, _, _ := term.GetSize(int(os.Stdout.Fd())) termWidth, _, _ := term.GetSize(int(os.Stdout.Fd()))
if wordWrap && termWidth >= 10 { if wordWrap && termWidth >= 10 {
for _, ch := range content { for _, ch := range content {
if state.lineLength+1 > termWidth - 5 { if state.lineLength+1 > termWidth-5 {
if runewidth.StringWidth(state.wordBuffer) > termWidth - 10 { if runewidth.StringWidth(state.wordBuffer) > termWidth-10 {
fmt.Printf("%s%c", state.wordBuffer, ch) fmt.Printf("%s%c", state.wordBuffer, ch)
state.wordBuffer = "" state.wordBuffer = ""
state.lineLength = 0 state.lineLength = 0
...@@ -765,7 +765,7 @@ func displayResponse(content string, wordWrap bool, state *displayResponseState) ...@@ -765,7 +765,7 @@ func displayResponse(content string, wordWrap bool, state *displayResponseState)
if runewidth.RuneWidth(ch) >= 2 { if runewidth.RuneWidth(ch) >= 2 {
state.wordBuffer = "" state.wordBuffer = ""
continue continue
} }
switch ch { switch ch {
case ' ': case ' ':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment