From 9c911f4bd357f6e9f9347742b7e291f1e3139c54 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sat, 14 May 2016 10:04:38 +0200 Subject: [PATCH] Fixes to file changed warning (#221) --- src/source.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/source.cc b/src/source.cc index afd8e93..dd3cfba 100644 --- a/src/source.cc +++ b/src/source.cc @@ -1574,9 +1574,11 @@ bool Source::View::on_button_press_event(GdkEventButton *event) { } bool Source::View::on_focus_in_event(GdkEventFocus* focus_event){ - if(boost::filesystem::last_write_time(file_path)>last_read_time) + boost::system::error_code ec; + auto last_write_time=boost::filesystem::last_write_time(file_path, ec); + if(!ec && last_write_time>last_read_time) Info::get().print(file_path.filename().string() + " was changed outside juCi++, continue with caution."); - return Gtk::Widget::on_focus_in_event(focus_event); + return Gsv::View::on_focus_in_event(focus_event); }; std::pair Source::View::find_tab_char_and_size() {