summaryrefslogtreecommitdiff
path: root/src/editor.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-02-09 23:47:55 +0000
committerMaxime Coste <frrrwww@gmail.com>2012-02-09 23:47:55 +0000
commitd84d085cc268c4127a624d05063f64df5ffa361d (patch)
tree990e7a453ba60c6153e7877ecd6649942d09fdb6 /src/editor.hh
parent04a37d8895a5e2e1a59e71d447c07e9aefcee64d (diff)
Merge captures into registers, implements register insertion
Diffstat (limited to 'src/editor.hh')
-rw-r--r--src/editor.hh19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/editor.hh b/src/editor.hh
index bd08801a..f019d053 100644
--- a/src/editor.hh
+++ b/src/editor.hh
@@ -5,12 +5,12 @@
#include "selection.hh"
#include "filter.hh"
#include "idvaluemap.hh"
-#include "hooks_manager.hh"
+#include "memoryview.hh"
namespace Kakoune
{
-class IncrementalInserter;
+class Register;
// An Editor is a buffer mutator
//
@@ -20,8 +20,8 @@ class Editor
{
public:
typedef BufferString String;
- typedef std::function<Selection (const Selection&)> Selector;
- typedef std::function<SelectionList (const Selection&)> MultiSelector;
+ typedef std::function<SelectionAndCaptures (const Selection&)> Selector;
+ typedef std::function<SelectionAndCapturesList (const Selection&)> MultiSelector;
Editor(Buffer& buffer);
virtual ~Editor() {}
@@ -29,8 +29,13 @@ public:
Buffer& buffer() const { return m_buffer; }
void erase();
+
void insert(const String& string);
+ void insert(const memoryview<String>& strings);
+
void append(const String& string);
+ void append(const memoryview<String>& strings);
+
void replace(const String& string);
void push_selections();
@@ -43,8 +48,8 @@ public:
void select(const Selector& selector, bool append = false);
void multi_select(const MultiSelector& selector);
- BufferString selection_content() const;
const SelectionList& selections() const { return m_selections.back(); }
+ std::vector<String> selections_content() const;
bool undo();
bool redo();
@@ -64,8 +69,6 @@ private:
int m_edition_level;
- SelectionList& selections() { return m_selections.back(); }
-
void check_invariant() const;
friend class IncrementalInserter;
@@ -108,7 +111,7 @@ public:
~IncrementalInserter();
void insert(const Editor::String& string);
- void insert_capture(size_t index);
+ void insert(const Register& reg);
void erase();
void move_cursors(const BufferCoord& offset);