billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=5e4f8141042632937ec4c46fef1e43517522e8e3

commit 5e4f8141042632937ec4c46fef1e43517522e8e3
Author: Boris Faure <[email protected]>
Date:   Sun Feb 10 19:00:43 2019 +0100

    termiointernals: fix selection invalidation + add doc
---
 src/bin/termiointernals.c | 19 +++++++++++++------
 src/bin/termpty.h         |  4 ++--
 src/bin/termptyext.c      |  2 +-
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/bin/termiointernals.c b/src/bin/termiointernals.c
index ec1ff62..311022e 100644
--- a/src/bin/termiointernals.c
+++ b/src/bin/termiointernals.c
@@ -1861,7 +1861,8 @@ termio_internal_mouse_up(Termio *sd,
              }
            return;
         }
-   if (sd->link.down.dnd) return;
+   if (sd->link.down.dnd)
+     return;
    if (sd->pty->selection.makesel)
      {
         if (sd->mouse_selection_scroll_timer)
@@ -1912,10 +1913,10 @@ termio_internal_mouse_up(Termio *sd,
                }
              termio_selection_dbl_fix(sd);
              _selection_newline_extend_fix(sd);
-             termio_smart_update_queue(sd);
              termio_take_selection(sd->self, ELM_SEL_TYPE_PRIMARY);
              _sel_fill_in_codepoints_array(sd);
              sd->pty->selection.makesel = EINA_FALSE;
+             termio_smart_update_queue(sd);
           }
      }
 }
@@ -2017,14 +2018,21 @@ termio_internal_mouse_move(Termio *sd,
         sd->mouse_selection_scroll_timer = NULL;
      }
 
-   if ((sd->mouse.cx == cx) && (sd->mouse.cy == cy)) return;
+   /* Cursor has not changed cells */
+   if ((sd->mouse.cx == cx) && (sd->mouse.cy == cy))
+     {
+        return;
+     }
 
    sd->mouse.cx = cx;
    sd->mouse.cy = cy;
    if (!modifiers.shift && !modifiers.ctrl)
      {
         if (_rep_mouse_move(sd, cx, cy))
-          return;
+          {
+             /* Mouse move already been taken care of */
+             return;
+          }
      }
    if (sd->link.down.dnd)
      {
@@ -2204,7 +2212,6 @@ termio_internal_render(Termio *sd,
         blk->active = EINA_FALSE;
      }
 
-
    inv = sd->pty->termstate.reverse;
    termpty_backlog_lock();
    termpty_backscroll_adjust(sd->pty, &sd->scroll);
@@ -2278,7 +2285,7 @@ termio_internal_render(Termio *sd,
              Eina_Unicode *u = NULL;
 
              if (cp && cur_sel_start_x <= x && x <= cur_sel_end_x)
-               u = cp;
+               u = cp++;
 
              if ((!cells) || (x >= w))
                {
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index 4f0c6c4..e369012 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -187,9 +187,9 @@ struct _Termpty
       } start, end, orig;
       Eina_Unicode *codepoints;
       time_t last_click;
-      unsigned char is_active : 1;
       unsigned char is_box    : 1;
-      unsigned char makesel   : 1;
+      unsigned char is_active : 1; // there is a visible selection
+      unsigned char makesel   : 1; // selection is being worked on
       unsigned char by_word   : 1;
       unsigned char by_line   : 1;
       unsigned char is_top_to_bottom : 1;
diff --git a/src/bin/termptyext.c b/src/bin/termptyext.c
index 592b6ab..5da778d 100644
--- a/src/bin/termptyext.c
+++ b/src/bin/termptyext.c
@@ -259,7 +259,7 @@ termpty_ext_handle(Termpty *ty,
 #if WITH_TESTS
       case 't':
         tytest_handle_escape_codes(ty, buf + 1);
-        return EINA_FALSE;
+        return EINA_TRUE;
         break;
 #endif
       default:

-- 


Reply via email to