summaryrefslogtreecommitdiff
path: root/src/context.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-07-24 19:18:39 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-07-24 19:18:39 +0100
commit731277a4253ee847efd2b10db6572b58ab7afe96 (patch)
treea04f6668973a503eb7c4ceee2006e23efa05841b /src/context.hh
parent826bf22eeff5a867f9126729d12343bba08f0d1f (diff)
Disable hooks on a per context basis, and propagate that to Insert mode
using \ before entering insert mode will disable hooks during the whole insert session rather than only the entering phase. That gives a nice way of pasting text into kakoune.
Diffstat (limited to 'src/context.hh')
-rw-r--r--src/context.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/context.hh b/src/context.hh
index a02f11fd..60b49abb 100644
--- a/src/context.hh
+++ b/src/context.hh
@@ -75,6 +75,12 @@ public:
bool is_editing() const { return m_edition_level!= 0; }
void disable_undo_handling() { m_edition_level = -1; }
+
+ bool are_user_hooks_disabled() const { return m_user_hooks_disabled; }
+
+ void disable_user_hooks() { ++m_user_hooks_disabled; }
+ void enable_user_hooks() { --m_user_hooks_disabled; }
+
private:
void begin_edition();
void end_edition();
@@ -94,6 +100,8 @@ private:
using JumpList = std::vector<SelectionList>;
JumpList m_jump_list;
JumpList::iterator m_current_jump = m_jump_list.begin();
+
+ int m_user_hooks_disabled = 0;
};
struct ScopedEdition