summaryrefslogtreecommitdiff
path: root/src/editor.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-09-07 14:29:29 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-09-07 14:29:29 +0200
commit287628ec19d42f2ff2323972c2e1e4975b3e146f (patch)
treedd7fc2fce688839e1815aa20917fd0ed70353ac6 /src/editor.hh
parent1e18dcba0f0e63792ccf64e167e039f2a4733815 (diff)
Editor::{select,move_cursor} takes a enum SelectMode parameter instead of a boolean
Diffstat (limited to 'src/editor.hh')
-rw-r--r--src/editor.hh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/editor.hh b/src/editor.hh
index 72e9ef1d..3549b57f 100644
--- a/src/editor.hh
+++ b/src/editor.hh
@@ -13,6 +13,13 @@ namespace Kakoune
class Register;
+enum class SelectMode
+{
+ Replace,
+ Extend,
+ Append,
+};
+
// An Editor is a buffer mutator
//
// The Editor class provides methods to manipulate a set of selections
@@ -23,6 +30,7 @@ public:
typedef std::function<SelectionAndCaptures (const Selection&)> Selector;
typedef std::function<SelectionAndCapturesList (const Selection&)> MultiSelector;
+
Editor(Buffer& buffer);
virtual ~Editor() {}
@@ -42,12 +50,14 @@ public:
void push_selections();
void pop_selections();
- void move_selections(const BufferCoord& offset, bool append = false);
+ void move_selections(const BufferCoord& offset,
+ SelectMode mode = SelectMode::Replace);
void clear_selections();
void keep_selection(int index);
void remove_selection(int index);
void select(const BufferIterator& iterator);
- void select(const Selector& selector, bool append = false);
+ void select(const Selector& selector,
+ SelectMode mode = SelectMode::Replace);
void multi_select(const MultiSelector& selector);
const SelectionList& selections() const { return m_selections.back(); }