summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-05 14:27:55 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-05 14:27:55 -0500
commit6b12382231f6fe8af16554d48f2a74d9a6e53835 (patch)
tree2918f5d1ec1a0ddaeae24cf1ef2f912f3026cffa /main.c
parent759404e118b701a7c0264de5791f0158db0c7e13 (diff)
ask to reload when file is externally changed
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index 709b23d..a7fbda0 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,4 @@
// @TODO:
-// - popup to reload files and config on change
// - find & replace (with regex)
// - split
// - completion
@@ -508,7 +507,12 @@ int main(int argc, char **argv) {
{
TextBuffer *active_buffer = ted->active_buffer;
if (active_buffer && buffer_externally_changed(active_buffer)) {
- buffer_reload(active_buffer);
+ if (settings->auto_reload)
+ buffer_reload(active_buffer);
+ else {
+ strbuf_cpy(ted->ask_reload, buffer_get_filename(active_buffer));
+ menu_open(ted, MENU_ASK_RELOAD);
+ }
}
}