Skip to content

Commit

Permalink
Adds key binding for clearing request editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ksysoev committed Oct 24, 2023
1 parent 6832909 commit 29b28c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/cli/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ func (c *Content) Clear() string {
}
}

c.text = []rune{}
c.pos = 0

return output
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/cli/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ func (ed *Editor) EditRequest(keyStream <-chan keyboard.KeyEvent, initBuffer str
return req, nil
case keyboard.KeyEsc:
return "", nil

case keyboard.KeyCtrlU:
fmt.Print(ed.content.Clear())
case keyboard.KeySpace:
fmt.Print(ed.content.InsertSymbol(' '))
case keyboard.KeyEnter:
Expand Down

0 comments on commit 29b28c9

Please sign in to comment.