summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-12-18 23:13:45 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-12-18 23:13:45 +0000
commiteee2cb3a6e4b2981d6775bef3658804b6e9873f1 (patch)
tree327ead3ea04f19856440af96d2536df55c30bbe9 /src/buffer.cc
parent1c8ee78d1a0abff5df3f771215786ede4613ccb9 (diff)
Revert "Add support for BufInsert/BufErase hooks"
This is potentially quite slow, and not used, reintroduce later if we have a use case for it. This reverts commit 5f3a477277828f3c698dd844c8df3614b55dd85b.
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/buffer.cc b/src/buffer.cc
index cddf58c7..57a243e9 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -374,11 +374,6 @@ void Buffer::apply_modification(const Modification& modification)
}
}
-static String change_spec(ByteCoord coord, ByteCount len)
-{
- return to_string(coord.line) + "." + to_string(coord.column) + "+" + to_string(len);
-}
-
BufferIterator Buffer::insert(const BufferIterator& pos, StringView content)
{
kak_assert(is_valid(pos.coord()));
@@ -396,11 +391,7 @@ BufferIterator Buffer::insert(const BufferIterator& pos, StringView content)
auto coord = pos == end() ? ByteCoord{line_count()} : pos.coord();
if (not (m_flags & Flags::NoUndo))
m_current_undo_group.emplace_back(Modification::Insert, coord, real_content);
- BufferIterator it{*this, do_insert(pos.coord(), real_content)};
-
- run_hook_in_own_context("BufInsert", change_spec(pos.coord(), real_content.length()));
-
- return it;
+ return {*this, do_insert(pos.coord(), real_content)};
}
BufferIterator Buffer::erase(BufferIterator begin, BufferIterator end)
@@ -415,13 +406,7 @@ BufferIterator Buffer::erase(BufferIterator begin, BufferIterator end)
if (not (m_flags & Flags::NoUndo))
m_current_undo_group.emplace_back(Modification::Erase, begin.coord(),
InternedString(string(begin.coord(), end.coord())));
-
- ByteCount len = distance(begin.coord(), end.coord());
- BufferIterator it{*this, do_erase(begin.coord(), end.coord())};
-
- run_hook_in_own_context("BufErase", change_spec(begin.coord(), len));
-
- return it;
+ return {*this, do_erase(begin.coord(), end.coord())};
}
bool Buffer::is_modified() const