feecc09b73
Make statusline folder-specific. Update filter, search and threading
status when changing folders.
Commit 2512c04
("statusline: implement per-account status") introduced
an account-specific statusline. This makes it account- and
folder-specific.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
28 lines
481 B
Go
28 lines
481 B
Go
package statusline
|
|
|
|
type folderState struct {
|
|
Search string
|
|
Filter string
|
|
FilterActivity string
|
|
|
|
Threading string
|
|
}
|
|
|
|
func (fs *folderState) State() []string {
|
|
var line []string
|
|
|
|
if fs.FilterActivity != "" {
|
|
line = append(line, fs.FilterActivity)
|
|
} else {
|
|
if fs.Filter != "" {
|
|
line = append(line, fs.Filter)
|
|
}
|
|
}
|
|
if fs.Search != "" {
|
|
line = append(line, fs.Search)
|
|
}
|
|
if fs.Threading != "" {
|
|
line = append(line, fs.Threading)
|
|
}
|
|
return line
|
|
}
|