summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-02-13 23:31:16 +0000
committerMaxime Coste <mawww@kakoune.org>2017-02-13 23:31:16 +0000
commite3a04dfa651ea4b32af64f207291ca8818adbf32 (patch)
tree929827a963dfe9d5d7152b5be6586b08f415ab5d /src
parent55bd3b7949f4a2227313133f7104f8d9ffde0d6c (diff)
Fix RegisterRestorer not handling potential throws on register assign
This should fix part of #1214
Diffstat (limited to 'src')
-rw-r--r--src/commands.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/commands.cc b/src/commands.cc
index 46f1e14b..65a0b752 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -1510,8 +1510,15 @@ public:
~RegisterRestorer()
{
- if (m_name != 0)
+ if (m_name != 0) try
+ {
RegisterManager::instance()[m_name] = m_save;
+ }
+ catch (runtime_error& e)
+ {
+ write_to_debug_buffer(format("Could not restore register '{}': {}",
+ m_name, e.what()));
+ }
}
private: