summaryrefslogtreecommitdiff
path: root/src/context.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-12-15 18:07:51 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-12-15 20:23:02 +0000
commit7267b8281fbcc21d96bb8cb760d2a4e881b4d5e5 (patch)
tree74891181f3d7b078bb6e1f4424e0449d843ac626 /src/context.cc
parente369b60258ba48eeeb53a91d15e6ae1a9bb6f10f (diff)
Move insert and erase to normal.cc, and move edition management to context
Diffstat (limited to 'src/context.cc')
-rw-r--r--src/context.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/context.cc b/src/context.cc
index 35e28731..6e94b174 100644
--- a/src/context.cc
+++ b/src/context.cc
@@ -187,4 +187,18 @@ const SelectionList& Context::selections() const
return editor().selections();
}
+void Context::begin_edition()
+{
+ ++m_edition_level;
+}
+
+void Context::end_edition()
+{
+ kak_assert(m_edition_level > 0);
+ if (m_edition_level == 1)
+ buffer().commit_undo_group();
+
+ --m_edition_level;
+}
+
}