fix: line freeze on dir open + var typo

This commit is contained in:
Kirn Kim
2023-04-28 14:08:34 -04:00
committed by Maas Lalani
parent 325fd48de7
commit 9bfe8185f1
+3 -3
View File
@@ -57,7 +57,7 @@ type errorMsg struct {
type readDirMsg []os.DirEntry
const (
marginBottom = 6
marginBottom = 5
fileSizeWidth = 8
paddingLeft = 2
)
@@ -227,12 +227,12 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
switch msg := msg.(type) {
case readDirMsg:
m.files = msg
m.max = m.Height
m.max = m.Height - 1
case tea.WindowSizeMsg:
if m.AutoHeight {
m.Height = msg.Height - marginBottom
}
m.max = m.Height
m.max = m.Height - 1
case tea.KeyMsg:
switch {
case key.Matches(msg, m.KeyMap.GoToTop):