This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository terminology.

View the commit online.

commit db5c3593fd837b807a4c18577cbb5737e87818d4
Author: Cedric BAIL <[email protected]>
AuthorDate: Fri Nov 20 18:43:14 2026 -0600

    termptyops: drop the clear parameter of the scroll functions
    
    Since IND and NEL blank the line they scroll in, every caller of
    termpty_text_scroll(), termpty_text_scroll_rev() and their _test
    variants passes EINA_TRUE: the row that comes in is always cleared.
    Remove the parameter, so that code which relies on the row being
    cleared after a scroll cannot be given a way to skip it.
    
    No behaviour change: the test suite checksums are unchanged.
---
 src/bin/termptyesc.c |  8 ++++----
 src/bin/termptyops.c | 34 +++++++++++++++-------------------
 src/bin/termptyops.h |  8 ++++----
 3 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 31d1244c..3428bdcd 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -331,7 +331,7 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
          if (ty->termstate.crlf)
            _cursor_to_start_of_line(ty);
          ty->cursor_state.cy++;
-         termpty_text_scroll_test(ty, EINA_TRUE);
+         termpty_text_scroll_test(ty);
          return;
       case 0x0d: // CR  '\r' (carriage ret)
          DBG("->CR");
@@ -6561,20 +6561,20 @@ _handle_esc(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
         DBG("move to prev line");
         ty->cursor_state.wrapnext = 0;
         ty->cursor_state.cy--;
-        termpty_text_scroll_rev_test(ty, EINA_TRUE);
+        termpty_text_scroll_rev_test(ty);
         return 1;
       case 'D': // move to next line
         DBG("move to next line");
         ty->cursor_state.wrapnext = 0;
         ty->cursor_state.cy++;
-        termpty_text_scroll_test(ty, EINA_TRUE);
+        termpty_text_scroll_test(ty);
         return 1;
       case 'E': // NEL
         DBG("NEL");
         ty->cursor_state.wrapnext = 0;
         _cursor_to_start_of_line(ty);
         ty->cursor_state.cy++;
-        termpty_text_scroll_test(ty, EINA_TRUE);
+        termpty_text_scroll_test(ty);
         return 1;
       case 'Z': // same a 'ESC [ Pn c'
         _term_txt_write(ty, "\033[?1;2C");
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index 587a9806..9632b66d 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -54,7 +54,7 @@ termpty_cells_clear(Termpty *ty, Termcell *cells, int count)
 
 
 void
-termpty_text_scroll(Termpty *ty, Eina_Bool clear)
+termpty_text_scroll(Termpty *ty)
 {
    Termcell *cells = NULL;
    int start_y = 0, end_y = ty->h - 1;
@@ -76,8 +76,7 @@ termpty_text_scroll(Termpty *ty, Eina_Bool clear)
      {
         // screen is a circular buffer now
         cells = &(ty->screen[ty->circular_offset * ty->w]);
-        if (clear)
-          termpty_cells_clear(ty, cells, ty->w);
+        termpty_cells_clear(ty, cells, ty->w);
 
         ty->circular_offset++;
         if (ty->circular_offset >= ty->h)
@@ -106,13 +105,12 @@ termpty_text_scroll(Termpty *ty, Eina_Bool clear)
              cells2 = &(TERMPTY_SCREEN(ty, x, y));
              memcpy(cells2, cells, w * sizeof(Termcell));
           }
-        if (clear)
-          termpty_cells_clear(ty, cells, w);
+        termpty_cells_clear(ty, cells, w);
      }
 }
 
 void
-termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
+termpty_text_scroll_rev(Termpty *ty)
 {
    Termcell *cells;
    int start_y = ty->termstate.top_margin, end_y = ty->h - 1;
@@ -132,8 +130,7 @@ termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
           ty->circular_offset = ty->h - 1;
 
         cells = &(ty->screen[ty->circular_offset * ty->w]);
-        if (clear)
-          termpty_cells_clear(ty, cells, ty->w);
+        termpty_cells_clear(ty, cells, ty->w);
      }
    else
      {
@@ -157,8 +154,7 @@ termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
              cells2 = &(TERMPTY_SCREEN(ty, x, y));
              memcpy(cells2, cells, w * sizeof(Termcell));
           }
-        if (clear)
-          termpty_cells_clear(ty, cells, w);
+        termpty_cells_clear(ty, cells, w);
      }
 }
 
@@ -181,7 +177,7 @@ _scroll_region_get(const Termpty *ty, int *start_y, int *end_y,
             (ty->termstate.right_margin == 0));
 }
 
-/* As n termpty_text_scroll(ty, EINA_TRUE), moving each row of a region
+/* As n termpty_text_scroll(ty), moving each row of a region
  * once rather than n times. */
 void
 termpty_text_scroll_lines(Termpty *ty, int n)
@@ -191,7 +187,7 @@ termpty_text_scroll_lines(Termpty *ty, int n)
    if ((n <= 1) || !_scroll_region_get(ty, &start_y, &end_y, &x, &w))
      {
         for (i = 0; i < n; i++)
-          termpty_text_scroll(ty, EINA_TRUE);
+          termpty_text_scroll(ty);
         return;
      }
    for (i = 0; i < n; i++)
@@ -213,7 +209,7 @@ termpty_text_scroll_lines(Termpty *ty, int n)
      termpty_cells_clear(ty, &(TERMPTY_SCREEN(ty, x, y)), w);
 }
 
-/* As n termpty_text_scroll_rev(ty, EINA_TRUE). */
+/* As n termpty_text_scroll_rev(ty). */
 void
 termpty_text_scroll_rev_lines(Termpty *ty, int n)
 {
@@ -222,7 +218,7 @@ termpty_text_scroll_rev_lines(Termpty *ty, int n)
    if ((n <= 1) || !_scroll_region_get(ty, &start_y, &end_y, &x, &w))
      {
         for (i = 0; i < n; i++)
-          termpty_text_scroll_rev(ty, EINA_TRUE);
+          termpty_text_scroll_rev(ty);
         return;
      }
    for (i = 0; i < n; i++)
@@ -242,7 +238,7 @@ termpty_text_scroll_rev_lines(Termpty *ty, int n)
 }
 
 void
-termpty_text_scroll_test(Termpty *ty, Eina_Bool clear)
+termpty_text_scroll_test(Termpty *ty)
 {
    int e = ty->h;
 
@@ -252,7 +248,7 @@ termpty_text_scroll_test(Termpty *ty, Eina_Bool clear)
    if (ty->cursor_state.cy == e)
      {
         /* Stepped off the bottom of the scrolling region: scroll it. */
-        termpty_text_scroll(ty, clear);
+        termpty_text_scroll(ty);
         ty->cursor_state.cy = e - 1;
      }
    else if (ty->cursor_state.cy >= ty->h)
@@ -269,7 +265,7 @@ termpty_text_scroll_test(Termpty *ty, Eina_Bool clear)
 }
 
 void
-termpty_text_scroll_rev_test(Termpty *ty, Eina_Bool clear)
+termpty_text_scroll_rev_test(Termpty *ty)
 {
    int b = 0;
 
@@ -277,7 +273,7 @@ termpty_text_scroll_rev_test(Termpty *ty, Eina_Bool clear)
      b = ty->termstate.top_margin;
    if (ty->cursor_state.cy < b)
      {
-        termpty_text_scroll_rev(ty, clear);
+        termpty_text_scroll_rev(ty);
         ty->cursor_state.cy = b;
         TERMPTY_RESTRICT_FIELD(ty->cursor_state.cy, 0, ty->h);
      }
@@ -502,7 +498,7 @@ termpty_text_append_known_ascii(Termpty *ty, const Eina_Unicode *codepoints,
              ty->cursor_state.wrapnext = 0;
              ty->cursor_state.cx = origin;
              ty->cursor_state.cy++;
-             termpty_text_scroll_test(ty, EINA_TRUE);
+             termpty_text_scroll_test(ty);
              cells = &(TERMPTY_SCREEN(ty, 0, ty->cursor_state.cy));
              wrapped = EINA_TRUE;
           }
diff --git a/src/bin/termptyops.h b/src/bin/termptyops.h
index aa99190d..d938dbb7 100644
--- a/src/bin/termptyops.h
+++ b/src/bin/termptyops.h
@@ -13,12 +13,12 @@ void termpty_cells_copy(Termpty *ty, const Termcell *cells, Termcell *dest, int
 void termpty_cells_clear(Termpty *ty, Termcell *cells, int count);
 void termpty_cells_att_fill_preserve_colors(Termpty *ty, Termcell *cells,
                                        Eina_Unicode codepoint, int count);
-void termpty_text_scroll(Termpty *ty, Eina_Bool clear);
-void termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear);
+void termpty_text_scroll(Termpty *ty);
+void termpty_text_scroll_rev(Termpty *ty);
 void termpty_text_scroll_lines(Termpty *ty, int n);
 void termpty_text_scroll_rev_lines(Termpty *ty, int n);
-void termpty_text_scroll_test(Termpty *ty, Eina_Bool clear);
-void termpty_text_scroll_rev_test(Termpty *ty, Eina_Bool clear);
+void termpty_text_scroll_test(Termpty *ty);
+void termpty_text_scroll_rev_test(Termpty *ty);
 void termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len);
 /* Same, for a caller that already scanned the run: 'plain_ascii_len' must not
  * exceed the length of the plain ASCII (0x20..0x7e) run at codepoints[0]. A

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to