add handling for offseting fsTree start

This commit is contained in:
2026-01-04 02:54:34 +00:00
parent 92efbf61aa
commit 3ecc365a9b
3 changed files with 14 additions and 10 deletions
+4 -3
View File
@@ -73,14 +73,14 @@ func (m *model) loadTreeCmd(path string) tea.Cmd {
} else {
targetPath = path
}
return treeLoadedMsg{tree: NewFsTree(targetPath)}
return treeLoadedMsg{tree: NewFsTree(targetPath, fsTreeStartOffset)}
}
}
func (m *model) layout(width, height int) {
m.terminalWidth = width
m.terminalHeight = height
m.fsTreeWidth, m.noteViewWidth = calculateLayout(width, m.fsTreeWidth)
}
@@ -134,7 +134,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "q", "ctrl+c":
return m, tea.Quit
}
var cmds []tea.Cmd
// Forward keyboard input to tree
@@ -206,6 +206,7 @@ func (m model) View() string {
Height(m.terminalHeight).
Width(m.fsTreeWidth).
Align(lipgloss.Left).
PaddingTop(fsTreeStartOffset).
PaddingRight(1).
Render(tree)