texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7542] reinstate foreground colour if background colour turned off


From: gavinsmith0123
Subject: [7542] reinstate foreground colour if background colour turned off
Date: Sat, 10 Dec 2016 10:11:27 +0000 (UTC)

Revision: 7542
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7542
Author:   gavin
Date:     2016-12-10 10:11:27 +0000 (Sat, 10 Dec 2016)
Log Message:
-----------
reinstate foreground colour if background colour turned off

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/terminal.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-12-09 22:37:29 UTC (rev 7541)
+++ trunk/ChangeLog     2016-12-10 10:11:27 UTC (rev 7542)
@@ -1,3 +1,12 @@
+2016-12-10  Gavin Smith  <address@hidden>
+
+       * info/terminal.c (terminal_switch_rendition): If turning off 
+       either foreground or background colour, call 
+       'terminal_default_colour' and reinstate any remaining foreground 
+       or background colour afterwards.  This fixes a bug where 
+       foreground colour might not be turned on again if background 
+       colour was turned off.
+
 2016-12-09  Gavin Smith  <address@hidden>
 
        * tp/Texinfo/Convert/Plaintext.pm (_convert): Remove extra blank 

Modified: trunk/info/terminal.c
===================================================================
--- trunk/info/terminal.c       2016-12-09 22:37:29 UTC (rev 7541)
+++ trunk/info/terminal.c       2016-12-10 10:11:27 UTC (rev 7542)
@@ -648,17 +648,17 @@
       terminal_end_all_modes ();
       old = 0;
     }
+  else if (!(new & COLOUR_MASK) && (old & COLOUR_MASK)
+           || !(new & BGCOLOUR_MASK) && (old & BGCOLOUR_MASK))
+    {
+      terminal_default_colour ();
+      old &= ~(COLOUR_MASK|BGCOLOUR_MASK);
+    }
 
   if ((new & COLOUR_MASK) != (old & COLOUR_MASK))
     {
-      /* Switch colour. */
-      if ((new & COLOUR_MASK) == 00)
+      if ((new & COLOUR_MASK) >= 8)
         {
-          terminal_default_colour ();
-          old &= ~BGCOLOUR_MASK;
-        }
-      else if ((new & COLOUR_MASK) >= 8)
-        {
           terminal_set_colour ((new & COLOUR_MASK) - 8);
         }
       /* Colour values from 1 to 7 don't do anything right now. */
@@ -666,16 +666,13 @@
   if ((new & BGCOLOUR_MASK) != (old & BGCOLOUR_MASK))
     {
       /* Switch colour. */
-      if ((new & BGCOLOUR_MASK) == 00)
+      if ((new & BGCOLOUR_MASK) >> 9 >= 8)
         {
-          terminal_default_colour ();
-        }
-      else if ((new & BGCOLOUR_MASK) >> 9 >= 8)
-        {
           terminal_set_bgcolour (((new & BGCOLOUR_MASK) >> 9) - 8);
         }
       /* Colour values from 1 to 7 don't do anything right now. */
     }
+
   if ((new & UNDERLINE_MASK) != (old & UNDERLINE_MASK))
     {
       if ((new & UNDERLINE_MASK))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]