add kak_timestamp env var to access current buffer timestamp

This commit is contained in:
Maxime Coste 2013-03-09 14:20:31 +01:00
parent 8cc9a44d47
commit 4db6e3e917

View File

@ -737,6 +737,9 @@ void register_env_vars()
shell_manager.register_env_var("bufname", shell_manager.register_env_var("bufname",
[](const String& name, const Context& context) [](const String& name, const Context& context)
{ return context.buffer().name(); }); { return context.buffer().name(); });
shell_manager.register_env_var("timestamp",
[](const String& name, const Context& context)
{ return int_to_str(context.buffer().timestamp()); });
shell_manager.register_env_var("selection", shell_manager.register_env_var("selection",
[](const String& name, const Context& context) [](const String& name, const Context& context)
{ return context.editor().selections_content().back(); }); { return context.editor().selections_content().back(); });