diff options
| author | Eike Plack <github@ekie.antares.uberspace.de> | 2014-12-23 02:49:53 +0100 |
|---|---|---|
| committer | Eike Plack <github@ekie.antares.uberspace.de> | 2014-12-23 02:49:53 +0100 |
| commit | 9f81093411ebb2b4eee2b20d8f0a5db68f0c653a (patch) | |
| tree | 82e2919214c587f18c09d261c0bcd376e29deb08 /src | |
| parent | 1b14cd1cfefac6c6c2a387df72c8ac2e0f6774b3 (diff) | |
Expose buffer list to shell over $kak_buflist
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cc | 11 |
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()); } |
