Skip to content

Commit acd0d31

Browse files
author
kencx
committed
fix: Update deprecated methods
1 parent 2959c10 commit acd0d31

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

ui/list/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ func (m *Model) style(c *config.Config) {
130130
s := table.RowStyles{
131131
Normal: lipgloss.NewStyle().Margin(0, 2).TabWidth(lipgloss.NoTabConversion),
132132
Heading: lipgloss.NewStyle().Margin(0, 1).Bold(true).TabWidth(lipgloss.NoTabConversion),
133-
Selected: cursor.Copy().Margin(0, 2).TabWidth(lipgloss.NoTabConversion),
134-
SelectedHeading: cursor.Copy().Margin(0, 1).Bold(true).TabWidth(lipgloss.NoTabConversion),
133+
Selected: cursor.Margin(0, 2).TabWidth(lipgloss.NoTabConversion),
134+
SelectedHeading: cursor.Margin(0, 1).Bold(true).TabWidth(lipgloss.NoTabConversion),
135135
Filtered: lipgloss.NewStyle().
136136
Foreground(lipgloss.Color(c.FilterFg)).
137137
Background(lipgloss.Color(c.FilterBg)).

ui/list/update.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
3737
case tea.MouseButtonWheelUp:
3838
m.cursor -= m.viewport.MouseWheelDelta
3939
if m.cursorPastViewTop() {
40-
m.viewport.LineUp(m.viewport.MouseWheelDelta)
40+
m.viewport.ScrollUp(m.viewport.MouseWheelDelta)
4141
}
4242
case tea.MouseButtonWheelDown:
4343
m.cursor += m.viewport.MouseWheelDelta
4444
if m.cursorPastViewBottom() {
45-
m.viewport.LineDown(m.viewport.MouseWheelDelta)
45+
m.viewport.ScrollDown(m.viewport.MouseWheelDelta)
4646
}
4747
}
4848
}
@@ -85,29 +85,29 @@ func (m *Model) handleNormal(msg tea.Msg) tea.Cmd {
8585
case key.Matches(msg, m.keys.Up):
8686
m.cursor--
8787
if m.cursorPastViewTop() {
88-
m.viewport.LineUp(1)
88+
m.viewport.ScrollUp(1)
8989
}
9090
case key.Matches(msg, m.keys.Down):
9191
m.cursor++
9292
if m.cursorPastViewBottom() {
93-
m.viewport.LineDown(1)
93+
m.viewport.ScrollDown(1)
9494
}
9595

9696
case key.Matches(msg, m.keys.UpFocus):
9797
m.cursor--
9898
if m.cursorPastViewTop() {
99-
m.viewport.LineUp(1)
99+
m.viewport.ScrollUp(1)
100100
}
101101
case key.Matches(msg, m.keys.DownFocus):
102102
m.cursor++
103103
if m.cursorPastViewBottom() {
104-
m.viewport.LineDown(1)
104+
m.viewport.ScrollDown(1)
105105
}
106106

107107
case key.Matches(msg, m.keys.HalfUp):
108108
m.cursor -= m.viewport.Height / 2
109109
if m.cursorPastViewTop() {
110-
m.viewport.HalfViewUp()
110+
m.viewport.HalfPageUp()
111111
}
112112

113113
// don't loop around
@@ -118,7 +118,7 @@ func (m *Model) handleNormal(msg tea.Msg) tea.Cmd {
118118
case key.Matches(msg, m.keys.HalfDown):
119119
m.cursor += m.viewport.Height / 2
120120
if m.cursorPastViewBottom() {
121-
m.viewport.HalfViewDown()
121+
m.viewport.HalfPageDown()
122122
}
123123

124124
// don't loop around
@@ -130,7 +130,7 @@ func (m *Model) handleNormal(msg tea.Msg) tea.Cmd {
130130
case key.Matches(msg, m.keys.FullUp):
131131
m.cursor -= m.viewport.Height
132132
if m.cursorPastViewTop() {
133-
m.viewport.ViewUp()
133+
m.viewport.PageUp()
134134
}
135135

136136
// don't loop around
@@ -142,7 +142,7 @@ func (m *Model) handleNormal(msg tea.Msg) tea.Cmd {
142142
case key.Matches(msg, m.keys.FullDown):
143143
m.cursor += m.viewport.Height
144144
if m.cursorPastViewBottom() {
145-
m.viewport.ViewDown()
145+
m.viewport.PageDown()
146146
}
147147

148148
// don't loop around
@@ -201,20 +201,20 @@ func (m *Model) handleSearch(msg tea.Msg) tea.Cmd {
201201
case key.Matches(msg, m.keys.UpFocus):
202202
m.cursor--
203203
if m.cursorPastViewTop() {
204-
m.viewport.LineUp(1)
204+
m.viewport.ScrollUp(1)
205205
}
206206
return nil
207207
case key.Matches(msg, m.keys.DownFocus):
208208
m.cursor++
209209
if m.cursorPastViewBottom() {
210-
m.viewport.LineDown(1)
210+
m.viewport.ScrollDown(1)
211211
}
212212
return nil
213213

214214
case key.Matches(msg, m.keys.HalfUp):
215215
m.cursor -= m.viewport.Height / 2
216216
if m.cursorPastViewTop() {
217-
m.viewport.HalfViewUp()
217+
m.viewport.HalfPageUp()
218218
}
219219

220220
// don't loop around
@@ -225,7 +225,7 @@ func (m *Model) handleSearch(msg tea.Msg) tea.Cmd {
225225
case key.Matches(msg, m.keys.HalfDown):
226226
m.cursor += m.viewport.Height / 2
227227
if m.cursorPastViewBottom() {
228-
m.viewport.HalfViewDown()
228+
m.viewport.HalfPageDown()
229229
}
230230

231231
// don't loop around
@@ -237,7 +237,7 @@ func (m *Model) handleSearch(msg tea.Msg) tea.Cmd {
237237
case key.Matches(msg, m.keys.FullUp):
238238
m.cursor -= m.viewport.Height
239239
if m.cursorPastViewTop() {
240-
m.viewport.ViewUp()
240+
m.viewport.PageUp()
241241
}
242242

243243
// don't loop around
@@ -249,7 +249,7 @@ func (m *Model) handleSearch(msg tea.Msg) tea.Cmd {
249249
case key.Matches(msg, m.keys.FullDown):
250250
m.cursor += m.viewport.Height
251251
if m.cursorPastViewBottom() {
252-
m.viewport.ViewDown()
252+
m.viewport.PageDown()
253253
}
254254

255255
// don't loop around

ui/table/row.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (r *Row) Render() string {
9393
if r.IsFiltered {
9494
// Inline to remove margins, paddings and borders from styledrunes
9595
unmatched := s.Selected.Inline(true)
96-
matched := s.Filtered.Copy().Inherit(unmatched)
96+
matched := s.Filtered.Inherit(unmatched)
9797
str := lipgloss.StyleRunes(r.String(), r.MatchedIndex, matched, unmatched)
9898

9999
if r.IsHeading {

0 commit comments

Comments
 (0)