diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-05-02 21:31:44 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-05-02 22:34:55 +1000 |
| commit | 74f90c1fc5feb34e25543a50b5371a398aba22c2 (patch) | |
| tree | 44feb19bf7659eafa832cfc38c77b55d4cd8ecbf /src/normal.cc | |
| parent | 4288f0fb3aad98ad26c85df89d9b84de1dad1132 (diff) | |
Refactor buffer undo tree
Store the undo tree as an array of undo nodes, instead of as a
pointer based tree.
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/normal.cc b/src/normal.cc index 92c9d863..35a093be 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1905,9 +1905,9 @@ void move_in_history(Context& context, NormalParams params) Buffer& buffer = context.buffer(); size_t timestamp = buffer.timestamp(); const int count = std::max(1, params.count); - const int history_id = (int)buffer.current_history_id() + direction * count; + const int history_id = (size_t)buffer.current_history_id() + direction * count; const int max_history_id = (int)buffer.next_history_id() - 1; - if (buffer.move_to((size_t)history_id)) + if (buffer.move_to((Buffer::HistoryId)history_id)) { auto ranges = compute_modified_ranges(buffer, timestamp); if (not ranges.empty()) |
