mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 17:52:33 +02:00
CopyRequest -> Copy & CopyAs
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -66,6 +66,8 @@ func (pr parsedRequest) fullURL() string {
|
||||
func formatAs(id, raw, scheme string) string {
|
||||
pr := parseRaw(raw, scheme)
|
||||
switch id {
|
||||
case "raw":
|
||||
return raw
|
||||
case "curl":
|
||||
return toCurl(pr)
|
||||
case "python":
|
||||
|
||||
@@ -36,6 +36,7 @@ func (f formatItem) Description() string { return f.desc }
|
||||
func (f formatItem) FilterValue() string { return f.title }
|
||||
|
||||
var allFormats = []list.Item{
|
||||
formatItem{"raw", "Raw", "raw HTTP request"},
|
||||
formatItem{"curl", "cURL", "command line HTTP request"},
|
||||
formatItem{"python", "Python", "requests library"},
|
||||
formatItem{"go", "Go", "net/http package"},
|
||||
|
||||
@@ -26,10 +26,10 @@ func (m *Model) View(background string) string {
|
||||
popupH := m.popupHeight()
|
||||
popup := style.RenderWithTitle(border, "Copy as", inner, popupInnerW+2, popupH)
|
||||
|
||||
return overlayCenter(background, popup, m.width, m.height)
|
||||
return OverlayCenter(background, popup, m.width, m.height)
|
||||
}
|
||||
|
||||
func overlayCenter(bg, popup string, w, h int) string {
|
||||
func OverlayCenter(bg, popup string, w, h int) string {
|
||||
s := style.S
|
||||
|
||||
stripped := ansi.Strip(bg)
|
||||
|
||||
Reference in New Issue
Block a user