diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-02-17 10:19:54 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-02-17 11:21:26 +1100 |
| commit | 1ad3b8730283ade32d64c43b45de5aca59930de0 (patch) | |
| tree | 61168234753a9d7eefd9e78ed23304a41985c0e3 /src/context.hh | |
| parent | 924f30840bdde1b18602b3db8b63e2efb3517c21 (diff) | |
Collapse jumps based on current index change
The previous method, while likely more correct, could restore jump
lists containing references to already removed buffers.
Diffstat (limited to 'src/context.hh')
| -rw-r--r-- | src/context.hh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/context.hh b/src/context.hh index d8830b2e..b71e6547 100644 --- a/src/context.hh +++ b/src/context.hh @@ -21,7 +21,7 @@ class AliasRegistry; struct JumpList { - void push(SelectionList jump); + void push(SelectionList jump, Optional<size_t> index = {}); const SelectionList& forward(Context& context, int count); const SelectionList& backward(Context& context, int count); void forget_buffer(Buffer& buffer); @@ -33,6 +33,8 @@ struct JumpList friend bool operator!=(const JumpList& lhs, const JumpList& rhs) { return not (lhs == rhs); } + size_t current_index() const { return m_current; } + private: using Contents = Vector<SelectionList, MemoryDomain::Selections>; Contents m_jumps; |
