summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-09-19 14:49:40 +0200
committerBoris Faure <billiob@gmail.com>2015-09-19 14:51:24 +0200
commitcd6f66003ac46e2970c5558188c6792faea88b0d (patch)
tree18c1a569d4ec0b8462f1486bf32d6aeaebe7f5dc
parente963bfb37ff8bd0175c1a2f22b07bbde061e9d63 (diff)
correctly set working dir on split
-rw-r--r--src/bin/term_container.h2
-rw-r--r--src/bin/win.c29
2 files changed, 20 insertions, 11 deletions
diff --git a/src/bin/term_container.h b/src/bin/term_container.h
index cd4059f..5015140 100644
--- a/src/bin/term_container.h
+++ b/src/bin/term_container.h
@@ -46,7 +46,7 @@ struct _Term_Container {
46 Term *(*find_term_at_coords)(Term_Container *container, 46 Term *(*find_term_at_coords)(Term_Container *container,
47 Evas_Coord mx, Evas_Coord my); 47 Evas_Coord mx, Evas_Coord my);
48 void (*split)(Term_Container *tc, Term_Container *child, 48 void (*split)(Term_Container *tc, Term_Container *child,
49 const char *cmd, Eina_Bool is_horizontal); 49 Term *from, const char *cmd, Eina_Bool is_horizontal);
50 void (*size_eval)(Term_Container *container, Sizeinfo *info); 50 void (*size_eval)(Term_Container *container, Sizeinfo *info);
51 void (*swallow)(Term_Container *container, Term_Container *orig, 51 void (*swallow)(Term_Container *container, Term_Container *orig,
52 Term_Container *new_child); 52 Term_Container *new_child);
diff --git a/src/bin/win.c b/src/bin/win.c
index bb2b17b..20dbabe 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -264,9 +264,10 @@ _solo_tabs_new(Term_Container *tc)
264 264
265static void 265static void
266_solo_split(Term_Container *tc, Term_Container *child EINA_UNUSED, 266_solo_split(Term_Container *tc, Term_Container *child EINA_UNUSED,
267 Term *from,
267 const char *cmd, Eina_Bool is_horizontal) 268 const char *cmd, Eina_Bool is_horizontal)
268{ 269{
269 tc->parent->split(tc->parent, tc, cmd, is_horizontal); 270 tc->parent->split(tc->parent, tc, from, cmd, is_horizontal);
270} 271}
271 272
272static Term * 273static Term *
@@ -936,8 +937,8 @@ _term_container_is_splittable(Term_Container *tc, Eina_Bool is_horizontal)
936} 937}
937 938
938static void 939static void
939_win_split(Term_Container *tc, Term_Container *child, const char *cmd, 940_win_split(Term_Container *tc, Term_Container *child,
940 Eina_Bool is_horizontal) 941 Term *from, const char *cmd, Eina_Bool is_horizontal)
941{ 942{
942 Win *wn; 943 Win *wn;
943 944
@@ -952,7 +953,10 @@ _win_split(Term_Container *tc, Term_Container *child, const char *cmd,
952 Evas_Object *base; 953 Evas_Object *base;
953 Evas_Object *o; 954 Evas_Object *o;
954 955
955 tm = tc->focused_term_get(tc); 956 if (from)
957 tm = from;
958 else
959 tm = tc->focused_term_get(tc);
956 if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf))) 960 if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf)))
957 wdir = buf; 961 wdir = buf;
958 tm_new = term_new(wn, wn->config, 962 tm_new = term_new(wn, wn->config,
@@ -1414,6 +1418,7 @@ _split_bell(Term_Container *tc, Term_Container *child EINA_UNUSED)
1414 1418
1415static void 1419static void
1416_split_split(Term_Container *tc, Term_Container *child, 1420_split_split(Term_Container *tc, Term_Container *child,
1421 Term *from,
1417 const char *cmd, Eina_Bool is_horizontal) 1422 const char *cmd, Eina_Bool is_horizontal)
1418{ 1423{
1419 Split *split; 1424 Split *split;
@@ -1430,7 +1435,10 @@ _split_split(Term_Container *tc, Term_Container *child,
1430 Term_Container *tc_split, *tc_solo_new; 1435 Term_Container *tc_split, *tc_solo_new;
1431 Evas_Object *obj_split; 1436 Evas_Object *obj_split;
1432 1437
1433 tm = child->focused_term_get(child); 1438 if (from)
1439 tm = from;
1440 else
1441 tm = child->focused_term_get(child);
1434 if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf))) 1442 if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf)))
1435 wdir = buf; 1443 wdir = buf;
1436 tm_new = term_new(wn, wn->config, 1444 tm_new = term_new(wn, wn->config,
@@ -1580,7 +1588,7 @@ split_horizontally(Evas_Object *win EINA_UNUSED, Evas_Object *term,
1580 if (!tm) return; 1588 if (!tm) return;
1581 1589
1582 tc = tm->container; 1590 tc = tm->container;
1583 tc->split(tc, tc, cmd, EINA_TRUE); 1591 tc->split(tc, tc, tm, cmd, EINA_TRUE);
1584} 1592}
1585 1593
1586void 1594void
@@ -1594,7 +1602,7 @@ split_vertically(Evas_Object *win EINA_UNUSED, Evas_Object *term,
1594 if (!tm) return; 1602 if (!tm) return;
1595 1603
1596 tc = tm->container; 1604 tc = tm->container;
1597 tc->split(tc, tc, cmd, EINA_FALSE); 1605 tc->split(tc, tc, tm, cmd, EINA_FALSE);
1598} 1606}
1599 1607
1600/* }}} */ 1608/* }}} */
@@ -2625,9 +2633,10 @@ tab_item_new(Tabs *tabs, Term_Container *child)
2625 2633
2626static void 2634static void
2627_tabs_split(Term_Container *tc, Term_Container *child EINA_UNUSED, 2635_tabs_split(Term_Container *tc, Term_Container *child EINA_UNUSED,
2636 Term *from,
2628 const char *cmd, Eina_Bool is_horizontal) 2637 const char *cmd, Eina_Bool is_horizontal)
2629{ 2638{
2630 tc->parent->split(tc->parent, tc, cmd, is_horizontal); 2639 tc->parent->split(tc->parent, tc, from, cmd, is_horizontal);
2631} 2640}
2632 2641
2633static Term_Container * 2642static Term_Container *
@@ -3330,7 +3339,7 @@ _cb_split_h(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
3330 Term_Container *tc = term->container; 3339 Term_Container *tc = term->container;
3331 3340
3332 assert(tc->type == TERM_CONTAINER_TYPE_SOLO); 3341 assert(tc->type == TERM_CONTAINER_TYPE_SOLO);
3333 tc->split(tc, tc, NULL, EINA_TRUE); 3342 tc->split(tc, tc, term, NULL, EINA_TRUE);
3334} 3343}
3335 3344
3336static void 3345static void
@@ -3340,7 +3349,7 @@ _cb_split_v(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
3340 Term_Container *tc = term->container; 3349 Term_Container *tc = term->container;
3341 3350
3342 assert(tc->type == TERM_CONTAINER_TYPE_SOLO); 3351 assert(tc->type == TERM_CONTAINER_TYPE_SOLO);
3343 tc->split(tc, tc, NULL, EINA_FALSE); 3352 tc->split(tc, tc, term, NULL, EINA_FALSE);
3344} 3353}
3345 3354
3346static void 3355static void