summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-09-27 11:55:34 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-09-27 11:55:34 +0100
commite2720f1fbe09649e6da282cd33b9794867d3d0fb (patch)
treebb5f906151c28fc5fde6078b842a71c0ba4fc318 /src/buffer.cc
parent122a799ecb7dd1a6d6ff392ab9dc9d88fafad770 (diff)
Store timespec for buffer fs timestamps, not just time_t
time_t has a resolution of one second, which cause troubles when a file changes multiple time during that same second.
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buffer.cc b/src/buffer.cc
index 0685e5b3..02f076d0 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -18,7 +18,7 @@ namespace Kakoune
{
Buffer::Buffer(String name, Flags flags, BufferLines lines,
- time_t fs_timestamp)
+ timespec fs_timestamp)
: Scope(GlobalScope::instance()),
m_name((flags & Flags::File) ? real_path(parse_filename(name)) : std::move(name)),
m_display_name((flags & Flags::File) ? compact_path(m_name) : m_name),
@@ -160,7 +160,7 @@ struct Buffer::Modification
}
};
-void Buffer::reload(BufferLines lines, time_t fs_timestamp)
+void Buffer::reload(BufferLines lines, timespec fs_timestamp)
{
if (lines.empty())
lines.emplace_back(StringData::create("\n"));
@@ -531,13 +531,13 @@ ByteCoord Buffer::char_prev(ByteCoord coord) const
return coord;
}
-time_t Buffer::fs_timestamp() const
+timespec Buffer::fs_timestamp() const
{
kak_assert(m_flags & Flags::File);
return m_fs_timestamp;
}
-void Buffer::set_fs_timestamp(time_t ts)
+void Buffer::set_fs_timestamp(timespec ts)
{
kak_assert(m_flags & Flags::File);
m_fs_timestamp = ts;