Skip to content

Commit

Permalink
Adds clearing request editor before sending request to reduce clutter…
Browse files Browse the repository at this point in the history
…ing terminal
  • Loading branch information
ksysoev committed Oct 24, 2023
1 parent 408ece1 commit a14f3c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cli/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ func (ed *Editor) EditRequest(keyStream <-chan keyboard.KeyEvent, initBuffer str
case keyboard.KeyCtrlC, keyboard.KeyCtrlD:
return "", fmt.Errorf("interrupted")
case keyboard.KeyCtrlS:
fmt.Print(ed.content.MoveToEnd() + "\n")

req := ed.content.ToRequest()

fmt.Print(ed.content.Clear())

if req == "" {
return req, fmt.Errorf("cannot send empty request")
}
Expand Down

0 comments on commit a14f3c0

Please sign in to comment.