summaryrefslogtreecommitdiff
path: root/src/register_manager.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-08-10 11:26:26 +1000
committerMaxime Coste <mawww@kakoune.org>2024-08-12 20:02:11 +1000
commit560e3631ec57d34c679e6b0faec1e0efdd18d915 (patch)
tree4b4e00ab1fefaaa4a98b3d6a7c46fab50120fd8b /src/register_manager.cc
parent6ed01f402b3a54495c8d9e462b7674864fbbe402 (diff)
Move debug utils to debug.hh/debug.cc
Lots of code includes buffer_utils.hh just for write_to_debug_buffer which pulls many unnecessary dependencies. Reorganise to reduce compile times.
Diffstat (limited to 'src/register_manager.cc')
-rw-r--r--src/register_manager.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/register_manager.cc b/src/register_manager.cc
index 254104a4..b9d09a52 100644
--- a/src/register_manager.cc
+++ b/src/register_manager.cc
@@ -4,11 +4,22 @@
#include "context.hh"
#include "hash_map.hh"
#include "format.hh"
+#include "ranges.hh"
#include "hook_manager.hh"
namespace Kakoune
{
+Register::RestoreInfo Register::save(const Context& context)
+{
+ return get(context) | gather<RestoreInfo>();
+}
+
+void Register::restore(Context& context, const RestoreInfo& info)
+{
+ set(context, info, true);
+}
+
void StaticRegister::set(Context& context, ConstArrayView<String> values, bool)
{
m_content.assign(values.begin(), values.end());