summaryrefslogtreecommitdiffstats
path: root/pkg/gui/modes/filtering/filtering.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/modes/filtering/filtering.go')
-rw-r--r--pkg/gui/modes/filtering/filtering.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/pkg/gui/modes/filtering/filtering.go b/pkg/gui/modes/filtering/filtering.go
index ca8026dc0..368df31f2 100644
--- a/pkg/gui/modes/filtering/filtering.go
+++ b/pkg/gui/modes/filtering/filtering.go
@@ -1,19 +1,21 @@
package filtering
type Filtering struct {
- path string // the filename that gets passed to git log
+ path string // the filename that gets passed to git log
+ author string // the author that gets passed to git log
}
-func New(path string) Filtering {
- return Filtering{path: path}
+func New(path string, author string) Filtering {
+ return Filtering{path: path, author: author}
}
func (m *Filtering) Active() bool {
- return m.path != ""
+ return m.path != "" || m.author != ""
}
func (m *Filtering) Reset() {
m.path = ""
+ m.author = ""
}
func (m *Filtering) SetPath(path string) {
@@ -23,3 +25,11 @@ func (m *Filtering) SetPath(path string) {
func (m *Filtering) GetPath() string {
return m.path
}
+
+func (m *Filtering) SetAuthor(author string) {
+ m.author = author
+}
+
+func (m *Filtering) GetAuthor() string {
+ return m.author
+}