summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-10-22 19:24:26 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-10-22 19:24:26 +0100
commit38df8765862c9d1f2cf71c907ec908a581707d2b (patch)
tree9b488b57023527dba2adfdd00bcf94ab5677d5ab /src
parent7f23d4b756fc419787408b3be7c7fcc9dfe01cc9 (diff)
Reread file timestamp at the moment the user choose to keep
The previous behaviour ended up asking twice for reloading if the buffer was modified again after Kakoune had detected the first change.
Diffstat (limited to 'src')
-rw-r--r--src/client.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client.cc b/src/client.cc
index 92cadaec..3143a0a7 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -147,7 +147,7 @@ void Client::check_buffer_fs_timestamp()
pos, get_face("Information"), MenuStyle::Prompt);
m_input_handler.on_next_key(KeymapMode::None,
- [this, filename, ts](Key key, Context& context) {
+ [this, filename](Key key, Context& context) {
Buffer* buf = BufferManager::instance().get_buffer_ifp(filename);
m_ui->info_hide();
// buffer got deleted while waiting for the key, do nothing
@@ -157,7 +157,8 @@ void Client::check_buffer_fs_timestamp()
reload_buffer(context, filename);
else if (key == 'k' or key == 'n')
{
- buf->set_fs_timestamp(ts);
+ // reread timestamp in case the file was modified again
+ buf->set_fs_timestamp(get_fs_timestamp(filename));
print_status({ "'" + buf->display_name() + "' kept",
get_face("Information") });
}