Merge remote-tracking branch 'origin/master' into v2-exp-update

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2025-03-25 11:31:38 -03:00
9 changed files with 120 additions and 81 deletions
+6 -3
View File
@@ -182,10 +182,10 @@ func newStack() stack {
}
}
func (m *Model) pushView(selected, minIdx, maxIdx int) {
func (m *Model) pushView(selected, minimum, maximum int) {
m.selectedStack.Push(selected)
m.minStack.Push(minIdx)
m.maxStack.Push(maxIdx)
m.minStack.Push(minimum)
m.maxStack.Push(maximum)
}
func (m *Model) popView() (int, int, int) {
@@ -225,6 +225,9 @@ func (m Model) readDir(path string, showHidden bool) tea.Cmd {
// SetHeight sets the height of the file picker.
func (m *Model) SetHeight(h int) {
m.height = h
if m.maxIdx > m.height-1 {
m.maxIdx = m.minIdx + m.height - 1
}
}
// Height returns the height of the file picker.