diff options
| author | Maxime Coste <mawww@kakoune.org> | 2023-08-23 14:09:47 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2023-08-23 14:13:22 +1000 |
| commit | 9c0c6b8fd5a7ea8b819798add9f0605da749062b (patch) | |
| tree | fb1e95ea1f0adeff258a4f0147be64e42f0ff60b /src/context.hh | |
| parent | 1e38045d702ec6eb2425016d9b02636270ab1b1e (diff) | |
Revert "Only make cursor visible after buffer or selection change"
This is currently broken on various corner cases and breaks the
"master branch should be good for day to day work" implicit rule,
ongoing work to stabilize this feature will take place on the
no-cursor-move-on-scroll branch until its deemed ready.
This reverts commit 1e38045d702ec6eb2425016d9b02636270ab1b1e.
Closes #4963
Diffstat (limited to 'src/context.hh')
| -rw-r--r-- | src/context.hh | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/context.hh b/src/context.hh index 119e4495..69377148 100644 --- a/src/context.hh +++ b/src/context.hh @@ -144,7 +144,6 @@ public: void repeat_last_select() { if (m_last_select) m_last_select(*this); } Buffer* last_buffer() const; - private: void begin_edition(); void end_edition(); @@ -216,16 +215,9 @@ struct ScopedEdition ScopedEdition(Context& context) : m_context{context}, m_buffer{context.has_buffer() ? &context.buffer() : nullptr} - { - if (m_buffer) - m_context.begin_edition(); - } + { if (m_buffer) m_context.begin_edition(); } - ~ScopedEdition() - { - if (m_buffer) - m_context.end_edition(); - } + ~ScopedEdition() { if (m_buffer) m_context.end_edition(); } Context& context() const { return m_context; } private: @@ -238,19 +230,11 @@ struct ScopedSelectionEdition ScopedSelectionEdition(Context& context) : m_context{context}, m_buffer{not (m_context.flags() & Context::Flags::Draft) and context.has_buffer() ? &context.buffer() : nullptr} - { - if (m_buffer) - m_context.m_selection_history.begin_edition(); - } - + { if (m_buffer) m_context.m_selection_history.begin_edition(); } ScopedSelectionEdition(ScopedSelectionEdition&& other) : m_context{other.m_context}, m_buffer{other.m_buffer} { other.m_buffer = nullptr; } - ~ScopedSelectionEdition() - { - if (m_buffer) - m_context.m_selection_history.end_edition(); - } + ~ScopedSelectionEdition() { if (m_buffer) m_context.m_selection_history.end_edition(); } private: Context& m_context; SafePtr<Buffer> m_buffer; |
