Skip to content

Commit cb6f840

Browse files
committed
chore: revert "chore: deprecate some StartupOptions in favor of Cmds (#1307)"
This reverts commit 75d1b4b.
1 parent ee7cf45 commit cb6f840

File tree

2 files changed

+14
-40
lines changed

2 files changed

+14
-40
lines changed

options.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,13 @@ func WithoutSignals() ProgramOption {
106106
//
107107
// To enter the altscreen once the program has already started running use the
108108
// EnterAltScreen command.
109-
//
110-
// Deprecated: use the [EnterAltScreen] [Cmd] in your [Model.Init] instead.
111109
func WithAltScreen() ProgramOption {
112110
return func(p *Program) {
113111
p.startupOptions |= withAltScreen
114112
}
115113
}
116114

117115
// WithoutBracketedPaste starts the program with bracketed paste disabled.
118-
//
119-
// Deprecated: use the [EnableBracketedPaste] [Cmd] in your [Model.Init]
120-
// instead.
121116
func WithoutBracketedPaste() ProgramOption {
122117
return func(p *Program) {
123118
p.startupOptions |= withoutBracketedPaste
@@ -139,9 +134,6 @@ func WithoutBracketedPaste() ProgramOption {
139134
// running use the DisableMouse command.
140135
//
141136
// The mouse will be automatically disabled when the program exits.
142-
//
143-
// Deprecated: use the [EnableMouseCellMotion] [Cmd] in your [Model.Init]
144-
// instead.
145137
func WithMouseCellMotion() ProgramOption {
146138
return func(p *Program) {
147139
p.startupOptions |= withMouseCellMotion // set
@@ -167,9 +159,6 @@ func WithMouseCellMotion() ProgramOption {
167159
// running use the DisableMouse command.
168160
//
169161
// The mouse will be automatically disabled when the program exits.
170-
//
171-
// Deprecated: use the [EnableMouseAllMotion] [Cmd] in your [Model.Init]
172-
// instead.
173162
func WithMouseAllMotion() ProgramOption {
174163
return func(p *Program) {
175164
p.startupOptions |= withMouseAllMotion // set
@@ -199,10 +188,6 @@ func WithoutRenderer() ProgramOption {
199188
//
200189
// Deprecated: this incurs a noticeable performance hit. A future release will
201190
// optimize ANSI automatically without the performance penalty.
202-
//
203-
// Deprecated: this will be removed in a future release. This ANSI compressor
204-
// has major performance implications and we don't recommend using it. In v2,
205-
// rendering bandwidth will be decreased significantly.
206191
func WithANSICompressor() ProgramOption {
207192
return func(p *Program) {
208193
p.startupOptions |= withANSICompressor
@@ -260,8 +245,6 @@ func WithFPS(fps int) ProgramOption {
260245
// Note that while most terminals and multiplexers support focus reporting,
261246
// some do not. Also note that tmux needs to be configured to report focus
262247
// events.
263-
//
264-
// Deprecated: use the [EnableReportFocus] [Cmd] in your [Model.Init] instead.
265248
func WithReportFocus() ProgramOption {
266249
return func(p *Program) {
267250
p.startupOptions |= withReportFocus

screen.go

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ func ClearScreen() Msg {
2424
type clearScreenMsg struct{}
2525

2626
// EnterAltScreen is a special command that tells the Bubble Tea program to
27-
// enter the alternate screen buffer (i.e. the full terminal window). The
28-
// altscreen will be automatically exited when the program quits. To manually
29-
// exit the altscreen while the program is running, use [ExitAltScreen].
27+
// enter the alternate screen buffer.
3028
//
3129
// Because commands run asynchronously, this command should not be used in your
3230
// model's Init function. To initialize your program with the altscreen enabled
@@ -51,17 +49,15 @@ func ExitAltScreen() Msg {
5149
}
5250

5351
// exitAltScreenMsg in an internal message signals that the program should exit
54-
// alternate screen buffer. You can send a exitAltScreenMsg with
55-
// [ExitAltScreen].
52+
// alternate screen buffer. You can send a exitAltScreenMsg with ExitAltScreen.
5653
type exitAltScreenMsg struct{}
5754

5855
// EnableMouseCellMotion is a special command that enables mouse click,
5956
// release, and wheel events. Mouse movement events are also captured if
6057
// a mouse button is pressed (i.e., drag events).
6158
//
6259
// Because commands run asynchronously, this command should not be used in your
63-
// model's Init function. Use the [WithMouseCellMotion] [ProgramOption]
64-
// instead.
60+
// model's Init function. Use the WithMouseCellMotion ProgramOption instead.
6561
func EnableMouseCellMotion() Msg {
6662
return enableMouseCellMotionMsg{}
6763
}
@@ -76,7 +72,7 @@ type enableMouseCellMotionMsg struct{}
7672
// button is pressed, effectively enabling support for hover interactions.
7773
//
7874
// Many modern terminals support this, but not all. If in doubt, use
79-
// [EnableMouseCellMotion] instead.
75+
// EnableMouseCellMotion instead.
8076
//
8177
// Because commands run asynchronously, this command should not be used in your
8278
// model's Init function. Use the WithMouseAllMotion ProgramOption instead.
@@ -112,9 +108,6 @@ type hideCursorMsg struct{}
112108

113109
// ShowCursor is a special command for manually instructing Bubble Tea to show
114110
// the cursor.
115-
//
116-
// Deprecated: this will be removed in a future release. In v2, the cursor will
117-
// can be manged via a dedicated API.
118111
func ShowCursor() Msg {
119112
return showCursorMsg{}
120113
}
@@ -124,10 +117,9 @@ func ShowCursor() Msg {
124117
type showCursorMsg struct{}
125118

126119
// EnableBracketedPaste is a special command that tells the Bubble Tea program
127-
// to accept bracketed paste input. To disable bracketed paste, use
128-
// [DisableBracketedPaste].
120+
// to accept bracketed paste input.
129121
//
130-
// Also note that bracketed paste will be automatically disabled when the
122+
// Note that bracketed paste will be automatically disabled when the
131123
// program quits.
132124
func EnableBracketedPaste() Msg {
133125
return enableBracketedPasteMsg{}
@@ -139,18 +131,17 @@ func EnableBracketedPaste() Msg {
139131
type enableBracketedPasteMsg struct{}
140132

141133
// DisableBracketedPaste is a special command that tells the Bubble Tea program
142-
// to accept bracketed paste input. To enable bracketed paste, use
143-
// [EnableBracketedPaste].
134+
// to accept bracketed paste input.
144135
//
145-
// Also note that bracketed paste will be automatically disabled when the
136+
// Note that bracketed paste will be automatically disabled when the
146137
// program quits.
147138
func DisableBracketedPaste() Msg {
148139
return disableBracketedPasteMsg{}
149140
}
150141

151-
// disableBracketedPasteMsg in an internal message signals that bracketed paste
152-
// should be disabled. You can send an disableBracketedPasteMsg with
153-
// DisableBracketedPaste.
142+
// disableBracketedPasteMsg in an internal message signals that
143+
// bracketed paste should be disabled. You can send an
144+
// disableBracketedPasteMsg with DisableBracketedPaste.
154145
type disableBracketedPasteMsg struct{}
155146

156147
// enableReportFocusMsg is an internal message that signals to enable focus
@@ -176,7 +167,7 @@ func DisableReportFocus() Msg {
176167
// EnterAltScreen enters the alternate screen buffer, which consumes the entire
177168
// terminal window. ExitAltScreen will return the terminal to its former state.
178169
//
179-
// Deprecated: Use the [EnterAltScreen] [Cmd] instead.
170+
// Deprecated: Use the WithAltScreen ProgramOption instead.
180171
func (p *Program) EnterAltScreen() {
181172
if p.renderer != nil {
182173
p.renderer.enterAltScreen()
@@ -199,7 +190,7 @@ func (p *Program) ExitAltScreen() {
199190
// EnableMouseCellMotion enables mouse click, release, wheel and motion events
200191
// if a mouse button is pressed (i.e., drag events).
201192
//
202-
// Deprecated: Use the [EnableMouseCellMotion] [Cmd] instead.
193+
// Deprecated: Use the WithMouseCellMotion ProgramOption instead.
203194
func (p *Program) EnableMouseCellMotion() {
204195
if p.renderer != nil {
205196
p.renderer.enableMouseCellMotion()
@@ -224,7 +215,7 @@ func (p *Program) DisableMouseCellMotion() {
224215
// regardless of whether a mouse button is pressed. Many modern terminals
225216
// support this, but not all.
226217
//
227-
// Deprecated: Use the [EnableMouseAllMotion] [Cmd] instead.
218+
// Deprecated: Use the WithMouseAllMotion ProgramOption instead.
228219
func (p *Program) EnableMouseAllMotion() {
229220
if p.renderer != nil {
230221
p.renderer.enableMouseAllMotion()

0 commit comments

Comments
 (0)