summaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-05 17:13:33 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-05 17:13:33 -0500
commit87fe34bdbaa2d840d5d4e988ffd789eb3e7a039a (patch)
tree8375a985f55e8b5dbbd72f161cbc34111a8fd957 /ui.c
parentedbad154a65f47dc77dbb901801651e28c4f5e55 (diff)
cd to last file selector directory
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui.c b/ui.c
index 58fd94e..62015ee 100644
--- a/ui.c
+++ b/ui.c
@@ -96,7 +96,6 @@ static char *selector_update(Ted *ted, Selector *s) {
float scroll_speed = 2.5f;
s->scroll += scroll_speed * (float)ted->scroll_total_y;
selector_clamp_scroll(ted, s);
-
return ret;
}
@@ -468,6 +467,8 @@ static char *file_selector_update(Ted *ted, FileSelector *fs) {
}
free(files);
+ // set cwd to this (if no buffers are open, the "open" menu should use the last file selector's cwd)
+ strbuf_cpy(ted->cwd, cwd);
} else {
ted_seterr(ted, "Couldn't list directory '%s'.", cwd);
}