From 06723ff579b692867c6ab87e3838d04e9d044912 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Sat, 13 May 2023 12:29:16 +0200 Subject: dirtree: clear msglist for virtual nodes Clear the message list when a virtual node is selected. Add a VirtualNodeCallback to the Dirlist interface. Reported-by: Tim Culverhouse Signed-off-by: Koni Marti Acked-by: Robin Jarry --- widgets/dirlist.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'widgets/dirlist.go') diff --git a/widgets/dirlist.go b/widgets/dirlist.go index 6a10c99a..25d1e7ff 100644 --- a/widgets/dirlist.go +++ b/widgets/dirlist.go @@ -31,6 +31,8 @@ type DirectoryLister interface { List() []string ClearList() + OnVirtualNode(func()) + NextPrev(int) CollapseFolder() @@ -99,6 +101,9 @@ func (dirlist *DirectoryList) ClearList() { dirlist.dirs = []string{} } +func (dirlist *DirectoryList) OnVirtualNode(_ func()) { +} + func (dirlist *DirectoryList) Update(msg types.WorkerMessage) { switch msg := msg.(type) { case *types.Done: -- cgit