]> git.mdlowis.com Git - archive/afm.git/commitdiff
default new windows to focused window's path
authora bellenir <a@bellenir.com>
Thu, 24 Jul 2014 00:40:37 +0000 (00:40 +0000)
committera bellenir <a@bellenir.com>
Thu, 24 Jul 2014 00:40:37 +0000 (00:40 +0000)
source/screen.c

index 44262a1bdf987610ca5395fb2d83b1c8f1869d05..5a51c05fde67d3269105edd040319bc303360b80 100644 (file)
@@ -84,8 +84,8 @@ static void screen_place_windows(void) {
 static frame_t* screen_frame_new(void) {
     frame_t* p_frame = (frame_t*)mem_allocate(sizeof(frame_t),&screen_frame_free);
     p_frame->p_win = newwin(1, 1, 0, 0);
-    //TODO use current focused window's path
-    p_frame->workdir = workdir_new(get_current_dir_name());
+    char* path = state_get_focused_frame() ? state_get_focused_frame()->workdir->path : get_current_dir_name();
+    p_frame->workdir = workdir_new(path);
     return p_frame;
 }