diff options
Diffstat (limited to 'src/editor.hh')
| -rw-r--r-- | src/editor.hh | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/editor.hh b/src/editor.hh index 0104d43d..95ef2f52 100644 --- a/src/editor.hh +++ b/src/editor.hh @@ -9,6 +9,8 @@ namespace Kakoune { +namespace InputModes { class Insert; } + class Register; enum class SelectMode @@ -88,6 +90,7 @@ public: bool is_editing() const { return m_edition_level!= 0; } private: friend struct scoped_edition; + friend class InputModes::Insert; void begin_edition(); void end_edition(); @@ -98,8 +101,6 @@ private: void check_invariant() const; - friend class IncrementalInserter; - safe_ptr<Buffer> m_buffer; DynamicSelectionList m_selections; size_t m_main_sel; @@ -114,32 +115,16 @@ struct scoped_edition ~scoped_edition() { m_editor.end_edition(); } -private: - Editor& m_editor; -}; -// An IncrementalInserter manage insert mode -class IncrementalInserter -{ -public: - IncrementalInserter(Editor& editor, InsertMode mode = InsertMode::Insert); - ~IncrementalInserter(); - - void insert(String content); - void insert(memoryview<String> strings); - void erase(); - void move_cursors(CharCount move); - void move_cursors(LineCount move); - - Buffer& buffer() const { return m_editor.buffer(); } Editor& editor() const { return m_editor; } - private: - InsertMode m_mode; - Editor& m_editor; - scoped_edition m_edition; + Editor& m_editor; }; +void avoid_eol(const Buffer& buffer, BufferCoord& coord); +void avoid_eol(const Buffer& buffer, Range& sel); +void sort_and_merge_overlapping(SelectionList& selections, size_t& main_selection); + } #endif // editor_hh_INCLUDED |
