billiob pushed a commit to branch master.

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

commit f93f1ef3baf6feea9f071b6085e611e5913e6e27
Author: Boris Faure <[email protected]>
Date:   Mon Feb 18 22:04:37 2019 +0100

    termiointernals: right-trim line selections
---
 src/bin/termiointernals.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/bin/termiointernals.c b/src/bin/termiointernals.c
index 22f7253..6c3aef5 100644
--- a/src/bin/termiointernals.c
+++ b/src/bin/termiointernals.c
@@ -389,7 +389,7 @@ end:
 static void
 _sel_line(Termio *sd, int cy)
 {
-   int y;
+   int x, y;
    ssize_t w = 0;
    Termcell *cells;
 
@@ -424,6 +424,15 @@ _sel_line(Termio *sd, int cy)
         sd->pty->selection.end.x = w - 1;
         y++;
      }
+   /* Right trim */
+   x = sd->pty->selection.end.x;
+   while (x > 0 && ((cells[x].codepoint == 0) ||
+                    (cells[x].codepoint == ' ') ||
+                    (cells[x].att.newline)))
+     {
+        x--;
+     }
+   sd->pty->selection.end.x = x;
    sd->pty->selection.end.y = y;
 
    sd->pty->selection.by_line = EINA_TRUE;

-- 


Reply via email to