termpty: cell is empty if bg is invisible. Closes T7707

terminology-1.4
Boris Faure 4 years ago
parent 923fa4a553
commit 48496b2eb5
  1. 11
      src/bin/termpty.c
  2. 30
      tests/cell_is_empty.sh
  3. 1
      tests/tests.results

@ -848,13 +848,10 @@ termpty_free(Termpty *ty)
static Eina_Bool
_termpty_cell_is_empty(const Termcell *cell)
{
if ((cell->codepoint != 0) &&
(!cell->att.invisible) &&
(cell->att.fg != COL_INVIS))
{
return EINA_FALSE;
}
return EINA_TRUE;
return (((cell->codepoint == 0) ||
(cell->att.invisible) ||
(cell->att.fg == COL_INVIS)) &&
(cell->att.bg == COL_INVIS));
}
static Eina_Bool

@ -0,0 +1,30 @@
#!/bin/sh
# char width: 7
# char height: 15
# clear screen
printf '\033[2J'
# set color
printf '\033[46;31;3m'
#move to 8;8
printf '\033[8;8H#'
#move to 8;40
printf '\033[8;40H#'
#switch to altbuf
printf '\033[?1049h'
# change colors
printf '\033[m\033[37m\033[40m'
# move to 0;0
printf '\033[H'
# clear screen
printf '\033[2J'
# change colors
printf '\033[37m\033[40m\033[97m\033[40m'
# move
printf '\033[3;2H'
# text
printf '**\o/**'

@ -77,6 +77,7 @@ uts.sh 075ff9f8c4f718784330bac4fcae932b
vpa.sh 4614f3c337e9d47fed3a4233df719617
decswbv.sh f90ffe93b1bd99c6b7385ca71c6793de
c2.sh 9f264ee84b6d89f1f9fa7b76abd442c0
cell_is_empty.sh 507bc5dca92d6f0d4c081a5146c13ed6
selection_simple.sh 1b3a915bf40ba8e869021055d368edf2
selection_box_simple.sh 1b3a915bf40ba8e869021055d368edf2
selection_all_directions.sh ad1c5bf43f0ec9a921616c3da10cab7f

Loading…
Cancel
Save