summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2013-08-27 15:17:25 +0200
committerBoris Faure <billiob@gmail.com>2013-08-27 15:17:25 +0200
commitabb0ea2a954883d624846e088e04c8bf1f9d5196 (patch)
tree3607d83c9317095993b231759cd6f9c4528482c5
parenta9e84188cea933f951848cb9100de71ffe4252d5 (diff)
fix line selection (triple click). Closes T305
-rw-r--r--src/bin/termio.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index b6e343f..3dce8ad 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -2250,15 +2250,43 @@ _smart_xy_to_cursor(Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *cx, int *
2250static void 2250static void
2251_sel_line(Evas_Object *obj, int cx __UNUSED__, int cy) 2251_sel_line(Evas_Object *obj, int cx __UNUSED__, int cy)
2252{ 2252{
2253 int y, w = 0;
2253 Termio *sd = evas_object_smart_data_get(obj); 2254 Termio *sd = evas_object_smart_data_get(obj);
2255 Termcell *cells;
2256
2254 if (!sd) return; 2257 if (!sd) return;
2255 2258
2259 termpty_cellcomp_freeze(sd->pty);
2260
2256 sd->cur.sel = 1; 2261 sd->cur.sel = 1;
2257 sd->cur.makesel = 0; 2262 sd->cur.makesel = 0;
2258 sd->cur.sel1.x = 0; 2263 sd->cur.sel1.x = 0;
2259 sd->cur.sel1.y = cy; 2264 sd->cur.sel1.y = cy;
2260 sd->cur.sel2.x = sd->grid.w - 1; 2265 sd->cur.sel2.x = sd->grid.w - 1;
2261 sd->cur.sel2.y = cy; 2266 sd->cur.sel2.y = cy;
2267
2268 y = cy;
2269 for (;;)
2270 {
2271 cells = termpty_cellrow_get(sd->pty, y - 1, &w);
2272 if (!cells || !cells[w-1].att.autowrapped) break;
2273
2274 y--;
2275 }
2276 sd->cur.sel1.y = y;
2277 y = cy;
2278
2279 for (;;)
2280 {
2281 cells = termpty_cellrow_get(sd->pty, y, &w);
2282 if (!cells || !cells[w-1].att.autowrapped) break;
2283
2284 sd->cur.sel2.x = w - 1;
2285 y++;
2286 }
2287 sd->cur.sel2.y = y;
2288
2289 termpty_cellcomp_thaw(sd->pty);
2262} 2290}
2263 2291
2264static Eina_Bool 2292static Eina_Bool