summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-12-23 13:20:29 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-12-23 13:20:29 +0000
commitbf980eba04597997d62bf9dcf708404b80960e50 (patch)
tree44baac95d857981140c301990ee9ecbb9df0918f /src
parentff1f4dcb5c74b970dbc59ce4696daf2947d4d746 (diff)
parent9f81093411ebb2b4eee2b20d8f0a5db68f0c653a (diff)
Merge branch 'list_buffers'
Diffstat (limited to 'src')
-rw-r--r--src/main.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc
index 8b5d0114..885d7333 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -57,6 +57,17 @@ void register_env_vars()
[](StringView name, const Context& context) -> String
{ return context.buffer().name(); }
}, {
+ "buflist",
+ [](StringView name, const Context& context)
+ {
+ String res;
+ for (auto& buf : BufferManager::instance())
+ {
+ res += buf->display_name() + ":";
+ }
+ res.pop_back();
+ return res; }
+ }, {
"timestamp",
[](StringView name, const Context& context)
{ return to_string(context.buffer().timestamp()); }