billiob pushed a commit to branch master.

commit 17a70c5ba27f38354c9053988e41c8bd90e74c76
Author: Boris Faure <[email protected]>
Date:   Tue May 21 21:47:22 2013 +0200

    fix detecting link on last char of a backscroll line
---
 src/bin/termio.c     | 8 ++++----
 src/bin/termiolink.c | 3 +--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/bin/termio.c b/src/bin/termio.c
index 9c48c3e..eea90f6 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -4073,9 +4073,8 @@ termio_selection_get(Evas_Object *obj, int c1x, int c1y, 
int c2x, int c2y,
         if (!cells) continue;
         if (w > sd->grid.w) w = sd->grid.w;
         if (c1x >= w) continue;
-        if (c2x >= w) c2x = w - 1;
         start_x = c1x;
-        end_x = c2x;
+        end_x = (c2x >= w) ? w - 1 : c2x;
         if (c1y != c2y)
           {
              if (y == c1y) end_x = w - 1;
@@ -4103,7 +4102,8 @@ termio_selection_get(Evas_Object *obj, int c1x, int c1y, 
int c2x, int c2y,
              else if (cells[x].att.newline)
                {
                   last0 = -1;
-                  eina_strbuf_append_char(sb, '\n');
+                  if ((y != c2y) || (x != end_x))
+                    eina_strbuf_append_char(sb, '\n');
                   break;
                }
              else if (cells[x].att.tab)
@@ -4130,7 +4130,7 @@ termio_selection_get(Evas_Object *obj, int c1x, int c1y, 
int c2x, int c2y,
                   txtlen = codepoint_to_utf8(cells[x].codepoint, txt);
                   if (txtlen > 0)
                     eina_strbuf_append_length(sb, txt, txtlen);
-                  if (x == (w - 1))
+                  if ((x == (w - 1)) && (x != c2x))
                     {
                        if (!cells[x].att.autowrapped)
                          eina_strbuf_append_char(sb, '\n');
diff --git a/src/bin/termiolink.c b/src/bin/termiolink.c
index e8c4445..188d2c7 100644
--- a/src/bin/termiolink.c
+++ b/src/bin/termiolink.c
@@ -109,7 +109,6 @@ _termio_link_find(Evas_Object *obj, int cx, int cy,
    termio_size_get(obj, &w, &h);
    sc = termio_scroll_get(obj);
    if ((w <= 0) || (h <= 0)) return NULL;
-   if (!coord_back(&x1, &y1, w, h)) goback = EINA_FALSE;
    for (;;)
      {
         s = termio_selection_get(obj, x1, y1 - sc, x2, y2 - sc, &len);
@@ -172,7 +171,7 @@ _termio_link_find(Evas_Object *obj, int cx, int cy,
              if (len > 1)
                {
                   if (((endmatch) && (s[len - 1] == endmatch)) ||
-                      ((!endmatch) && 
+                      ((!endmatch) &&
                           ((isspace(s[len - 1])) || (s[len - 1] == '>'))
                       ))
                     {

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

Reply via email to