aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buffer/mod.rs8
-rw-r--r--src/buffer/threads.rs4
2 files changed, 12 insertions, 0 deletions
diff --git a/src/buffer/mod.rs b/src/buffer/mod.rs
index fe83a97..10b49c1 100644
--- a/src/buffer/mod.rs
+++ b/src/buffer/mod.rs
@@ -45,3 +45,11 @@ impl Client {
pub enum Buffer {
Threads(Threads),
}
+
+impl Buffer {
+ pub fn name(&self) -> String {
+ match self {
+ Buffer::Threads(t) => t.name(),
+ }
+ }
+}
diff --git a/src/buffer/threads.rs b/src/buffer/threads.rs
index ddef067..9439bb4 100644
--- a/src/buffer/threads.rs
+++ b/src/buffer/threads.rs
@@ -53,6 +53,10 @@ impl Threads {
res
}
+ pub fn name(&self) -> String {
+ format!("threads: '{}'", self.query)
+ }
+
pub fn reload(&mut self) {
self.threads = db::open(DatabaseMode::ReadOnly)
.unwrap()