summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEike Plack <github@ekie.antares.uberspace.de>2014-12-23 02:49:53 +0100
committerEike Plack <github@ekie.antares.uberspace.de>2014-12-23 02:49:53 +0100
commit9f81093411ebb2b4eee2b20d8f0a5db68f0c653a (patch)
tree82e2919214c587f18c09d261c0bcd376e29deb08 /src
parent1b14cd1cfefac6c6c2a387df72c8ac2e0f6774b3 (diff)
Expose buffer list to shell over $kak_buflist
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()); }