aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/win.c
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:49:40 +0200
commite6b924a215760513856197299f35df07f485e569 (patch)
tree796485970678b57b01f575b494a779a835371dd4 /src/bin/win.c
parentsend ctrl[1-0] to term if "going to tab#" is not possible. Closes T2723 (diff)
downloadterminology-e6b924a215760513856197299f35df07f485e569.tar.gz
correctly set working dir on split
Diffstat (limited to 'src/bin/win.c')
-rw-r--r--src/bin/win.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index a37aaa5..eba1b04 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -264,9 +264,10 @@ _solo_tabs_new(Term_Container *tc)
static void
_solo_split(Term_Container *tc, Term_Container *child EINA_UNUSED,
+ Term *from,
const char *cmd, Eina_Bool is_horizontal)
{
- tc->parent->split(tc->parent, tc, cmd, is_horizontal);
+ tc->parent->split(tc->parent, tc, from, cmd, is_horizontal);
}
static Term *
@@ -936,8 +937,8 @@ _term_container_is_splittable(Term_Container *tc, Eina_Bool is_horizontal)
}
static void
-_win_split(Term_Container *tc, Term_Container *child, const char *cmd,
- Eina_Bool is_horizontal)
+_win_split(Term_Container *tc, Term_Container *child,
+ Term *from, const char *cmd, Eina_Bool is_horizontal)
{
Win *wn;
@@ -952,7 +953,10 @@ _win_split(Term_Container *tc, Term_Container *child, const char *cmd,
Evas_Object *base;
Evas_Object *o;
- tm = tc->focused_term_get(tc);
+ if (from)
+ tm = from;
+ else
+ tm = tc->focused_term_get(tc);
if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf)))
wdir = buf;
tm_new = term_new(wn, wn->config,
@@ -1414,6 +1418,7 @@ _split_bell(Term_Container *tc, Term_Container *child EINA_UNUSED)
static void
_split_split(Term_Container *tc, Term_Container *child,
+ Term *from,
const char *cmd, Eina_Bool is_horizontal)
{
Split *split;
@@ -1430,7 +1435,10 @@ _split_split(Term_Container *tc, Term_Container *child,
Term_Container *tc_split, *tc_solo_new;
Evas_Object *obj_split;
- tm = child->focused_term_get(child);
+ if (from)
+ tm = from;
+ else
+ tm = child->focused_term_get(child);
if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf)))
wdir = buf;
tm_new = term_new(wn, wn->config,
@@ -1580,7 +1588,7 @@ split_horizontally(Evas_Object *win EINA_UNUSED, Evas_Object *term,
if (!tm) return;
tc = tm->container;
- tc->split(tc, tc, cmd, EINA_TRUE);
+ tc->split(tc, tc, tm, cmd, EINA_TRUE);
}
void
@@ -1594,7 +1602,7 @@ split_vertically(Evas_Object *win EINA_UNUSED, Evas_Object *term,
if (!tm) return;
tc = tm->container;
- tc->split(tc, tc, cmd, EINA_FALSE);
+ tc->split(tc, tc, tm, cmd, EINA_FALSE);
}
/* }}} */
@@ -2605,9 +2613,10 @@ tab_item_new(Tabs *tabs, Term_Container *child)
static void
_tabs_split(Term_Container *tc, Term_Container *child EINA_UNUSED,
+ Term *from,
const char *cmd, Eina_Bool is_horizontal)
{
- tc->parent->split(tc->parent, tc, cmd, is_horizontal);
+ tc->parent->split(tc->parent, tc, from, cmd, is_horizontal);
}
static Term_Container *
@@ -3310,7 +3319,7 @@ _cb_split_h(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
Term_Container *tc = term->container;
assert(tc->type == TERM_CONTAINER_TYPE_SOLO);
- tc->split(tc, tc, NULL, EINA_TRUE);
+ tc->split(tc, tc, term, NULL, EINA_TRUE);
}
static void
@@ -3320,7 +3329,7 @@ _cb_split_v(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
Term_Container *tc = term->container;
assert(tc->type == TERM_CONTAINER_TYPE_SOLO);
- tc->split(tc, tc, NULL, EINA_FALSE);
+ tc->split(tc, tc, term, NULL, EINA_FALSE);
}
static void