-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add RawMsg and Raw command to print raw strings to the terminal
This adds a new message type, `RawMsg`, and a new command, `Raw`, that allows printing raw strings to the terminal without any intermediate processing.
- Loading branch information
1 parent
43a5b4d
commit 381649e
Showing
3 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package tea | ||
|
||
// RawMsg is a message that contains a string to be printed to the terminal | ||
// without any intermediate processing. | ||
type RawMsg struct { | ||
Msg any | ||
} | ||
|
||
// Raw is a command that prints the given string to the terminal without any | ||
// formatting. | ||
func Raw(r any) Cmd { | ||
return func() Msg { | ||
return RawMsg{r} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters