summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-07-24 22:53:44 +0100
committerMaxime Coste <frrrwww@gmail.com>2016-07-24 22:55:37 +0100
commit78fc88ae6dd472cfa575cb762c31390a480b6ca4 (patch)
tree8fb02a5fe6f3fe79d24bc3bf9fb47259e44e58bf /src
parent087a17eb24059da1a98596bb5c8e9064a72776f4 (diff)
Display some information when moving in history
Diffstat (limited to 'src')
-rw-r--r--src/normal.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 544fa08f..50f7ca61 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -1449,18 +1449,22 @@ void move_in_history(Context& context, NormalParams params)
{
Buffer& buffer = context.buffer();
size_t timestamp = buffer.timestamp();
- const size_t count = (size_t)std::max(1, params.count);
- const size_t history_id = buffer.current_history_id() +
+ const int count = std::max(1, params.count);
+ const int history_id = (int)buffer.current_history_id() +
(direction == Direction::Forward ? count : -count);
- if (buffer.move_to(history_id))
+ if (buffer.move_to((size_t)history_id))
{
auto ranges = compute_modified_ranges(buffer, timestamp);
if (not ranges.empty())
context.selections_write_only() = std::move(ranges);
context.selections().avoid_eol();
+
+ context.print_status({ format("moved to change #{}", history_id),
+ get_face("Information") });
}
else
- context.print_status({ "nothing left to redo", get_face("Information") });
+ context.print_status({ format("no such change: #{}", history_id),
+ get_face("Information") });
}
void exec_user_mappings(Context& context, NormalParams params)