From 6509ec2f9ab07cdf0df9938f30c2dbae9079c3b2 Mon Sep 17 00:00:00 2001 From: a bellenir Date: Thu, 24 Jul 2014 00:40:37 +0000 Subject: [PATCH] default new windows to focused window's path --- source/screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/screen.c b/source/screen.c index 44262a1..5a51c05 100644 --- a/source/screen.c +++ b/source/screen.c @@ -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; } -- 2.54.0