diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-09-23 13:18:58 +0900 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-09-23 13:18:58 +0900 |
| commit | 626ccc09cce8cffa23bf153689a01a2f9216755b (patch) | |
| tree | 64dfe5c95241dc3728e33448e77039b4a3403e6e /src/normal.cc | |
| parent | 3a5bb051a81887961b7e06d39db44c98da1a256c (diff) | |
| parent | b46c9ac630d65fe4791d410b752624018359251b (diff) | |
Merge remote-tracking branch 'Delapouite/next-history-id'
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/normal.cc b/src/normal.cc index 5c3bd2a6..0a82d4d4 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1775,6 +1775,7 @@ void move_in_history(Context& context, NormalParams params) const int count = std::max(1, params.count); const int history_id = (int)buffer.current_history_id() + (direction == Direction::Forward ? count : -count); + const int max_history_id = (int)buffer.next_history_id() - 1; if (buffer.move_to((size_t)history_id)) { auto ranges = compute_modified_ranges(buffer, timestamp); @@ -1782,11 +1783,13 @@ void move_in_history(Context& context, NormalParams params) context.selections_write_only() = std::move(ranges); context.selections().avoid_eol(); - context.print_status({ format("moved to change #{}", history_id), + context.print_status({ format("moved to change #{} ({})", + history_id, max_history_id), get_face("Information") }); } else - context.print_status({ format("no such change: #{}", history_id), + context.print_status({ format("no such change: #{} ({})", + history_id, max_history_id), get_face("Information") }); } |
