refactor & improve the fstree logic

This commit is contained in:
2026-01-03 18:35:58 +00:00
parent cfd302ba0e
commit 87c8382e7b
4 changed files with 76 additions and 49 deletions
+2 -2
View File
@@ -118,10 +118,10 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.tree.Update(fs.MsgHover{Line: -1})
}
if msg.Button == tea.MouseButtonLeft {
if msg.Button == tea.MouseButtonLeft && msg.Action == tea.MouseActionPress {
// within file tree
if msg.X < m.width {
m.tree.Update(fs.MsgSelectAtLine{Line: msg.Y})
m.tree.Update(fs.MsgLeftClickLine{Line: msg.Y})
content, err := m.tree.GetSelectedContent()
if err == nil {
m.viewport.SetContent(content)