[uim-commit] r635 - trunk/fep

yamamoto at freedesktop.org yamamoto at freedesktop.org
Sat Feb 12 07:43:32 PST 2005


Author: yamamoto
Date: 2005-02-12 07:43:29 -0800 (Sat, 12 Feb 2005)
New Revision: 635

Modified:
   trunk/fep/README.ja
   trunk/fep/draw.c
   trunk/fep/escseq.c
   trunk/fep/escseq.h
   trunk/fep/uim-fep.c
Log:
 * fep/{uim-fep.c,escseq.c,draw.c} bugfix


Modified: trunk/fep/README.ja
===================================================================
--- trunk/fep/README.ja	2005-02-11 18:50:43 UTC (rev 634)
+++ trunk/fep/README.ja	2005-02-12 15:43:29 UTC (rev 635)
@@ -153,7 +153,7 @@
         bind K eval 'exec cat' kill redisplay
         ¤³¤Î¤è¤¦¤Ë½ñ¤±¤Ð¡¢C-a J¤Çuim-fep¤ò¥Õ¥£¥ë¥¿¤È¤·¤Æµ¯Æ°¤·¡¢C-a K
         ¤Ç½ªÎ»¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
-        -S¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤ë¤È¡¢-s¥ª¥×¥·¥ç¥ó¤Ë¤«¤«¤ï¤é¤º¥â¡¼¥Éɽ¼¨¤Ë¤Ï
+        -s¥ª¥×¥·¥ç¥ó¤Ë¤«¤«¤ï¤é¤º¥â¡¼¥Éɽ¼¨¤Ë¤Ï
         backtick¤¬»È¤ï¤ì¤Þ¤¹¡£
 
   o -e command arg1 arg2 ...
@@ -209,7 +209,7 @@
   M-C-a .. M-C-z        ->        "<Control><Alt>a" ..  "<Control><Alt>z"
   return                ->        "<Control>m"
   backspace(C-h¤Î¤È¤­)  ->        "<Control>h"
-  backspace(C-?¤Î¤È¤­)  ->        "<Control>?"
+  backspace(C-?¤Î¤È¤­)  ->        "delete"
   backspace(¤½¤ì°Ê³°)   ->        "backspace"
   tab                   ->        "<Control>i"
   del, C-?              ->        "delete"

Modified: trunk/fep/draw.c
===================================================================
--- trunk/fep/draw.c	2005-02-11 18:50:43 UTC (rev 634)
+++ trunk/fep/draw.c	2005-02-12 15:43:29 UTC (rev 635)
@@ -105,7 +105,6 @@
 static void draw_subpreedit(struct preedit_tag *p, int start, int end);
 static int is_eq_region(void);
 static void draw_pseg(struct preedit_segment_tag *pseg, int start_width);
-static void change_attr(int attr);
 static int compare_preedit(struct preedit_tag *p1, struct preedit_tag *p2);
 static int compare_preedit_rev(struct preedit_tag *p1, struct preedit_tag *p2);
 static int min(int a, int b);
@@ -218,8 +217,12 @@
       put_cursor_invisible();
       if (s_gnu_screen) {
         put_cursor_left(prev_preedit->cursor);
-        put_erase(prev_preedit->width);
-        put_cursor_left(prev_preedit->width);
+        if (s_on_the_spot) {
+          put_delete(prev_preedit->width);
+        } else {
+          put_erase(prev_preedit->width);
+          put_cursor_left(prev_preedit->width);
+        }
       } else {
         erase_preedit();
       }
@@ -408,7 +411,7 @@
       }
       put_cursor_invisible();
       put_goto_lastline(0);
-      put_clear_to_end_of_line(prev_statusline_str_width);
+      put_clear_to_end_of_line();
       /* ¸õÊä°ìÍ÷¤ò¾Ã¤·¤¿¸å¤Ï¥â¡¼¥É¤òÉÁ²è¤¹¤ëɬÍפ¬¤¢¤ë */
       force = TRUE;
     } else if (s_status_type == BACKTICK) {
@@ -425,28 +428,24 @@
           put_save_cursor();
         }
         put_cursor_invisible();
-        put_exit_standout_mode();
-        put_exit_underline_mode();
         put_goto_lastline(0);
         /* ¸õÊ䤬ÁªÂò¤µ¤ì¤Æ¤¤¤ë¤« */
         if (candidate_col != UNDEFINED) {
           int byte_cand = (width2byte(statusline_str, candidate_col))[0];
           int byte_index = (width2byte(statusline_str, index_col))[0];
-          put_uim_str_len(statusline_str, byte_cand);
-          put_enter_standout_mode();
-          put_uim_str(candidate_str);
-          put_exit_standout_mode();
-          put_uim_str_len(statusline_str + byte_cand + strlen(candidate_str), byte_index - byte_cand - strlen(candidate_str));
+          put_uim_str_no_color_len(statusline_str, UPreeditAttr_None, byte_cand);
+          put_uim_str_no_color(candidate_str, UPreeditAttr_Reverse);
+          put_uim_str_no_color_len(statusline_str + byte_cand + strlen(candidate_str),
+              UPreeditAttr_None,
+              byte_index - byte_cand - strlen(candidate_str));
           assert(index_col != UNDEFINED);
-          put_uim_str(index_str);
-          put_uim_str(statusline_str + byte_index + strlen(index_str));
+          put_uim_str_no_color(index_str, UPreeditAttr_None);
+          put_uim_str_no_color(statusline_str + byte_index + strlen(index_str), UPreeditAttr_None);
         } else {
-          put_uim_str(statusline_str);
+          put_uim_str_no_color(statusline_str, UPreeditAttr_None);
         }
-        if (draw_background) {
-          put_clear_to_end_of_line(g_win->ws_col - statusline_str_width);
-        } else if (statusline_str_width < prev_statusline_str_width) {
-          put_clear_to_end_of_line(prev_statusline_str_width - statusline_str_width);
+        if (draw_background || statusline_str_width < prev_statusline_str_width) {
+          put_clear_to_end_of_line();
         }
         goto end_candidate;
       } else if (s_status_type == BACKTICK) {
@@ -461,10 +460,8 @@
             put_save_cursor();
           }
           put_cursor_invisible();
-          put_exit_standout_mode();
-          put_exit_underline_mode();
           put_goto_lastline(prev_candidate_col);
-          put_uim_str(prev_candidate_str);
+          put_uim_str_no_color(prev_candidate_str, UPreeditAttr_None);
         }
       }
       /* ÁªÂò¤µ¤ì¤¿¸õÊä¤òȿž¤¹¤ë */
@@ -474,10 +471,8 @@
             put_save_cursor();
           }
           put_cursor_invisible();
-          put_exit_underline_mode();
-          put_enter_standout_mode();
           put_goto_lastline(candidate_col);
-          put_uim_str(candidate_str);
+          put_uim_str_no_color(candidate_str, UPreeditAttr_Reverse);
         } else if (s_status_type == BACKTICK) {
           int byte;
           strncpy(s_candbuf, statusline_str, CANDSIZE - 1);
@@ -499,8 +494,6 @@
           put_save_cursor();
         }
         put_cursor_invisible();
-        put_exit_underline_mode();
-        put_exit_standout_mode();
         /* index_str¤Ïascii */
         if (prev_index_col != UNDEFINED) {
           for (i = 0; i < (int)strlen(index_str); i++) {
@@ -511,7 +504,7 @@
         }
         if (i < (int)strlen(index_str)) {
           put_goto_lastline(index_col + i);
-          put_uim_str(index_str + i);
+          put_uim_str_no_color(index_str + i, UPreeditAttr_None);
         }
       } else if (s_status_type == BACKTICK) {
         memcpy(s_candbuf + (width2byte(statusline_str, index_col))[0], index_str, strlen(index_str));
@@ -540,14 +533,10 @@
         }
         put_cursor_invisible();
         put_goto_lastline(0);
-        put_exit_standout_mode();
-        put_exit_underline_mode();
-        put_uim_str(mode_str);
+        put_uim_str_no_color(mode_str, UPreeditAttr_None);
         mode_width = strwidth(mode_str);
-        if (draw_background) {
-          put_clear_to_end_of_line(g_win->ws_col - mode_width);
-        } else if (prev_mode_width > mode_width) {
-          put_clear_to_end_of_line(prev_mode_width - mode_width);
+        if (draw_background || prev_mode_width > mode_width) {
+          put_clear_to_end_of_line();
         }
       } else if (s_status_type == BACKTICK) {
         strncpy(s_modebuf, mode_str, MODESIZE - 1);
@@ -615,7 +604,7 @@
 {
   assert(s_status_type == LASTLINE);
   put_goto_lastline(0);
-  put_clear_to_end_of_line(g_win->ws_col);
+  put_clear_to_end_of_line();
 }
 
 /*
@@ -688,14 +677,21 @@
     return;
   }
 
+  if (s_gnu_screen && s_on_the_spot && preedit->width > prev_preedit->width) {
+    put_insert(preedit->width - prev_preedit->width);
+  }
   draw_subpreedit(preedit, eq_width, preedit->width);
 
   if (s_gnu_screen) {
     if (preedit->width > prev_preedit->width) {
       put_cursor_left(preedit->width - preedit->cursor);
     } else {
-      put_erase(prev_preedit->width - preedit->width);
-      put_cursor_left(prev_preedit->width - preedit->cursor);
+      if (s_on_the_spot) {
+        put_delete(prev_preedit->width - preedit->width);
+      } else {
+        put_erase(prev_preedit->width - preedit->width);
+        put_cursor_left(prev_preedit->width - preedit->cursor);
+      }
     }
   } else {
     erase_prev_preedit();
@@ -761,8 +757,7 @@
     int seg_w = strwidth(seg_str);
     if (w + seg_w <= width) {
       if (s_gnu_screen) {
-        change_attr(p->pseg[i].attr);
-        put_uim_str(seg_str);
+        put_uim_str(seg_str, p->pseg[i].attr);
       } else {
         draw_pseg(&(p->pseg[i]), start + w);
       }
@@ -776,8 +771,7 @@
       int save_char = seg_str[byte];
       seg_str[byte] = '\0';
       if (s_gnu_screen) {
-        change_attr(p->pseg[i].attr);
-        put_uim_str(seg_str);
+        put_uim_str(seg_str, p->pseg[i].attr);
       } else {
         draw_pseg(&(p->pseg[i]), start + w);
       }
@@ -802,7 +796,6 @@
   int seg_w = strwidth(seg_str);
 
   assert(margin >= 0 && margin <= g_win->ws_col);
-  change_attr(pseg->attr);
 
   while (TRUE) {
     int *byte_width;
@@ -815,7 +808,7 @@
         byte_width = width2byte(seg_str, margin2);
         byte = byte_width[0];
         width = byte_width[1];
-        put_uim_str_len(seg_str, byte);
+        put_uim_str_len(seg_str, pseg->attr, byte);
         if (width < margin2) {
           put_cursor_address(s_head.row + lineno, s_prev_line2width[lineno]);
           put_insert(s_line2width[lineno] - s_prev_line2width[lineno]);
@@ -832,7 +825,7 @@
 
     /* ÀÞ¤êÊÖ¤¹É¬Íפ¬¤Ê¤¤¤« */
     if (seg_w < margin) {
-      put_uim_str(seg_str);
+      put_uim_str(seg_str, pseg->attr);
       break;
     }
 
@@ -841,7 +834,7 @@
     width = byte_width[1];
 
     /* ¹ÔËö¤Þ¤Ç½ÐÎÏ */
-    put_uim_str_len(seg_str, byte);
+    put_uim_str_len(seg_str, pseg->attr, byte);
 
     /* ±¦Ã¼¤Îʸ»ú¤ò¾Ã¤¹É¬Íפ¬¤¢¤ë¤« */
     if (s_line2width[lineno] < s_prev_line2width[lineno]) {
@@ -850,7 +843,6 @@
       } else {
         put_erase(s_prev_line2width[lineno] - s_line2width[lineno]);
       }
-      change_attr(pseg->attr);
       s_prev_line2width[lineno] = s_line2width[lineno];
     }
 
@@ -870,25 +862,6 @@
 }
 
 /*
- * °À­¤òattr¤Ë¤¹¤ë
- */
-static void change_attr(int attr)
-{
-  if (!(attr & UPreeditAttr_Reverse)) {
-    put_exit_standout_mode();
-  }
-  if (!(attr & UPreeditAttr_UnderLine)) {
-    put_exit_underline_mode();
-  }
-  if (attr & UPreeditAttr_Reverse) {
-    put_enter_standout_mode();
-  }
-  if (attr & UPreeditAttr_UnderLine) {
-    put_enter_underline_mode();
-  }
-}
-
-/*
  * p1¤Èp2¤ÎÀèƬ¤«¤é¤Î¶¦ÄÌÉôʬʸ»úÎó(°À­¤âÅù¤·¤¤)¤ÎÉý¤òÊÖ¤¹
  */
 static int compare_preedit(struct preedit_tag *p1, struct preedit_tag *p2)

Modified: trunk/fep/escseq.c
===================================================================
--- trunk/fep/escseq.c	2005-02-11 18:50:43 UTC (rev 634)
+++ trunk/fep/escseq.c	2005-02-12 15:43:29 UTC (rev 635)
@@ -86,8 +86,6 @@
 static int s_save = FALSE;
 /* Êݸ¤·¤¿¥«¡¼¥½¥ë */
 static struct point_tag s_save_cursor;
-/* ¥×¥ê¥¨¥Ç¥£¥Ã¥È¤È¥¹¥Æ¡¼¥¿¥¹¥é¥¤¥ó¤òÉÁ²è¤¹¤ë¥â¡¼¥É */
-static int s_uim_mode = FALSE;
 /* uim_mode¤Ë¤Ê¤ë¤È¤­¤Ë½ÐÎϤ¹¤ë¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ */
 static const char *s_enter_uim_mode;
 /* enter_underline_mode¤Ë´Þ¤Þ¤ì¤ë¿ô»ú */
@@ -148,8 +146,6 @@
 static void escseq2n2(const char *escseq, const char **first, const char **second);
 static const char *attr2escseq(const struct attribute_tag *attr);
 static void set_attr(const char *str, int len);
-static void put_enter_uim_mode(void);
-static void put_exit_uim_mode(void);
 static int my_putchar(int c);
 #ifndef HAVE_CFMAKERAW
 static int cfmakeraw(struct termios *termios_p);
@@ -574,73 +570,6 @@
 }
 
 /*
- * underline¥â¡¼¥É¤ò³«»Ï¤¹¤ë
- */
-void put_enter_underline_mode(void)
-{
-  put_enter_uim_mode();
-  if (!s_attr.underline) {
-    s_attr.underline = TRUE;
-    my_putp(enter_underline_mode);
-    debug(("<{_>"));
-  }
-}
-
-/*
- * underline¥â¡¼¥É¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤é¡¢underline¥â¡¼¥É¤Èstandout¥â¡¼¥É¤ò½ªÎ»¤¹¤ë
- */
-void put_exit_underline_mode(void)
-{
-  if (s_attr.underline) {
-    if (!s_uim_mode) {
-      s_uim_mode = TRUE;
-      debug(("<{uim>"));
-      s_attr_pty = s_attr;
-    }
-    put_exit_attribute_mode();
-    if (s_enter_uim_mode != NULL) {
-      my_putp(s_enter_uim_mode);
-      debug(("%s", s_enter_uim_mode));
-    }
-    /* debug(("<_}>")); */
-  }
-}
-
-/*
- * standout¥â¡¼¥É¤ò³«»Ï¤¹¤ë
- */
-void put_enter_standout_mode(void)
-{
-  put_enter_uim_mode();
-  if (!s_attr.standout) {
-    s_attr.standout = TRUE;
-    my_putp(enter_standout_mode);
-    debug(("<{r>"));
-  }
-}
-
-/*
- * standout¥â¡¼¥É¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤é¡¢underline¥â¡¼¥É¤Èstandout¥â¡¼¥É¤ò½ªÎ»¤¹¤ë
- */
-void put_exit_standout_mode(void)
-{
-  if (s_attr.standout) {
-    if (!s_uim_mode) {
-      s_uim_mode = TRUE;
-      debug(("<{uim>"));
-      s_attr_pty = s_attr;
-    }
-    put_exit_attribute_mode();
-    if (s_enter_uim_mode != NULL) {
-      my_putp(s_enter_uim_mode);
-      debug(("%s", s_enter_uim_mode));
-      debug(("<{uim>"));
-    }
-    /* debug(("<r}>")); */
-  }
-}
-
-/*
  * standout¥â¡¼¥É¡¢underline¥â¡¼¥É¤ò½ªÎ»¤¹¤ë
  * ʸ»ú¿§¡¢ÇØ·Ê¿§¤ò¸µ¤ËÌ᤹
  */
@@ -652,15 +581,16 @@
 }
 
 /*
- * °À­¤òfrom¤«¤éto¤ËÊѹ¹¤¹¤ë
+ * °À­¤òfrom¤«¤éto¤ËÊѹ¹¤·¡¢from <= to
  */
-static void change_attr(const struct attribute_tag *from, const struct attribute_tag *to)
+static void change_attr(struct attribute_tag *from, const struct attribute_tag *to)
 {
   const char *escseq;
-  if ((from->underline && !to->underline)
-      || (from->standout && !to->standout)
-      || (from->bold && !to->bold)
-      || (from->blink && !to->blink)
+
+  if (   (from->underline           && !to->underline)
+      || (from->standout            && !to->standout)
+      || (from->bold                && !to->bold)
+      || (from->blink               && !to->blink)
       || (from->foreground != FALSE && to->foreground == FALSE)
       || (from->background != FALSE && to->background == FALSE)
       ) {
@@ -690,40 +620,12 @@
   }
   if (escseq != NULL) {
     my_putp(escseq);
+    *from = *to;
     debug(("change_attr %s\n", escseq));
   }
 }
 
 /*
- * uim¥â¡¼¥É¤ò³«»Ï¤¹¤ë
- */
-static void put_enter_uim_mode(void)
-{
-  if (!s_uim_mode) {
-    s_uim_mode = TRUE;
-    s_attr_pty = s_attr;
-    s_attr_uim.standout = s_attr.standout;
-    s_attr_uim.underline = s_attr.underline;
-    change_attr(&s_attr, &s_attr_uim);
-    debug(("<{uim>"));
-    s_attr = s_attr_uim;
-  }
-}
-
-/*
- * uim¥â¡¼¥É¤ò½ªÎ»¤¹¤ë
- */
-static void put_exit_uim_mode(void)
-{
-  if (s_uim_mode) {
-    s_uim_mode = FALSE;
-    change_attr(&s_attr, &s_attr_pty);
-    debug(("<uim}>"));
-    s_attr = s_attr_pty;
-  }
-}
-
-/*
  * attr¤ËÂбþ¤¹¤ë¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤òÊÖ¤¹
  * ÊÖ¤êÃͤÏÀÅŪ¤Ê¥Ð¥Ã¥Õ¥¡
  */
@@ -895,6 +797,7 @@
   if (must_free) {
     free((char *)free_str);
   }
+  s_attr_pty = s_attr;
 }
 
 /*
@@ -943,13 +846,20 @@
 void put_delete(int n)
 {
   const char *tmp;
+
   if (n <= 0) {
     return;
   }
+
   if (back_color_erase) {
-    put_exit_underline_mode();
-    put_exit_standout_mode();
+    struct attribute_tag no_background_attr = s_attr_none;
+    if (!(s_attr.underline || s_attr.standout || s_attr.blink || s_attr.background)) {
+      no_background_attr.bold       = s_attr.bold;
+      no_background_attr.foreground = s_attr.foreground;
+    }
+    change_attr(&s_attr, &no_background_attr);
   }
+
   tmp = tparm(parm_dch, n);
   my_putp(tmp);
   debug(("<del %d>", n));
@@ -994,34 +904,36 @@
 {
   int i;
   char *spaces;
+
   if (n <= 0) {
     return;
   }
+
   spaces = malloc(n + 1);
-  put_exit_underline_mode();
-  put_exit_standout_mode();
   for (i = 0; i < n; i++) {
     spaces[i] = ' ';
   }
   spaces[n] = '\0';
-  put_uim_str(spaces);
+
+  put_uim_str(spaces, UPreeditAttr_None);
+
   free(spaces);
+  debug(("<put erase %d>", n));
 }
 
 /*
  * underline¥â¡¼¥É¤Èstandout¥â¡¼¥É¤ò½ªÎ»¤·¤Æ¹ÔËö¤Þ¤Ç¾Ãµî
  * ¥«¡¼¥½¥ë°ÌÃÖ¤ÏÊѤï¤é¤Ê¤¤
  */
-void put_clear_to_end_of_line(int width)
+void put_clear_to_end_of_line(void)
 {
-  put_enter_uim_mode();
-  if (s_attr_uim.background != FALSE && !back_color_erase) {
-    put_erase(width);
-    return;
-  }
   if (back_color_erase) {
-    put_exit_standout_mode();
-    put_exit_underline_mode();
+    struct attribute_tag no_background_attr = s_attr_none;
+    if (!(s_attr.underline || s_attr.standout || s_attr.blink || s_attr.background)) {
+      no_background_attr.bold       = s_attr.bold;
+      no_background_attr.foreground = s_attr.foreground;
+    }
+    change_attr(&s_attr, &no_background_attr);
   }
   my_putp(clr_eol);
   debug(("<clear>"));
@@ -1042,8 +954,9 @@
  * str¤òüËö¤Ë½ÐÎϤ¹¤ë
  * ²èÌ̤α¦Ã¼¤ò±Û¤¨¤Æ¤Ï¤¤¤±¤Ê¤¤
  * ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Ï´Þ¤Þ¤Ê¤¤
+ * ²¼Àþ¡¢È¿Å¾¤Ïattr¤Ç»ØÄê
  */
-void put_uim_str(const char *str)
+void put_uim_str(const char *str, int attr)
 {
   if (str[0] == '\0') {
     return;
@@ -1052,26 +965,53 @@
     free(s_escseq_buf);
     s_escseq_buf = NULL;
   }
-  put_enter_uim_mode();
+
+  s_attr_uim.standout = attr & UPreeditAttr_Reverse;
+  s_attr_uim.underline = attr & UPreeditAttr_UnderLine;
+  change_attr(&s_attr, &s_attr_uim);
+
   s_cursor.col += strwidth(str);
   assert(s_cursor.col <= g_win->ws_col);
   write(g_win_out, str, strlen(str));
   debug(("<put_uim_str \"%s\">", str));
 }
 
-/* str¤Îlen¤À¤±½ÐÎϤ¹¤ë
+/*
+ * str¤Îlen¤À¤±½ÐÎϤ¹¤ëput_uim_str
  * const char *str¤È¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¤°ì»þŪ¤Ë½ñ´¹¤¨¤ë¤Î¤Çstr¤òʸ»úÎóÄê¿ô
  * ¤Ë¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡¥
  */
-void put_uim_str_len(const char *str, int len)
+void put_uim_str_len(const char *str, int attr, int len)
 {
   char save_char = str[len];
   ((char *)str)[len] = '\0';
-  put_uim_str(str);
+  put_uim_str(str, attr);
   ((char *)str)[len] = save_char;
 }
 
 /*
+ * str¤ò¿§¤Ê¤·¤Ç½ÐÎϤ¹¤ëput_uim_str
+ */
+void put_uim_str_no_color(const char *str, int attr)
+{
+  struct attribute_tag save_attr = s_attr_uim;
+  s_attr_uim = s_attr_none;
+  put_uim_str(str, attr);
+  s_attr_uim = save_attr;
+}
+
+/*
+ * str¤Îlen¤À¤±½ÐÎϤ¹¤ëput_uim_str_no_color
+ */
+void put_uim_str_no_color_len(const char *str, int attr, int len)
+{
+  char save_char = str[len];
+  ((char *)str)[len] = '\0';
+  put_uim_str_no_color(str, attr);
+  ((char *)str)[len] = save_char;
+}
+
+/*
  * pty¤«¤é¤Î½ÐÎÏstr¤òüËö¤Ë½ÐÎϤ¹¤ë
  * ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ò´Þ¤à¾ì¹ç¤¬¤¢¤ë
  */
@@ -1080,7 +1020,8 @@
   if (len == 0) {
     return;
   }
-  put_exit_uim_mode();
+  change_attr(&s_attr, &s_attr_pty);
+  /* put_exit_uim_mode(); */
   write(g_win_out, str, len);
   set_attr(str, len);
   g_commit = FALSE;

Modified: trunk/fep/escseq.h
===================================================================
--- trunk/fep/escseq.h	2005-02-11 18:50:43 UTC (rev 634)
+++ trunk/fep/escseq.h	2005-02-12 15:43:29 UTC (rev 635)
@@ -59,10 +59,6 @@
 void put_restore_cursor(void);
 void put_cursor_invisible(void);
 void put_cursor_normal(void);
-void put_enter_underline_mode(void);
-void put_exit_underline_mode(void);
-void put_enter_standout_mode(void);
-void put_exit_standout_mode(void);
 void put_exit_attribute_mode(void);
 void put_cursor_address(int row, int col);
 void put_cursor_address_p(struct point_tag *p);
@@ -71,10 +67,12 @@
 void put_crlf(void);
 void put_goto_lastline(int col);
 void put_erase(int n);
-void put_clear_to_end_of_line(int width);
+void put_clear_to_end_of_line(void);
 void put_change_scroll_region(int start, int end);
-void put_uim_str(const char *str);
-void put_uim_str_len(const char *str, int len);
+void put_uim_str(const char *str, int attr);
+void put_uim_str_len(const char *str, int attr, int len);
+void put_uim_str_no_color(const char *str, int attr);
+void put_uim_str_no_color_len(const char *str, int attr, int len);
 void put_pty_str(const char *str, int len);
 char *cut_padding(const char *escseq);
 void escseq_winch(void);

Modified: trunk/fep/uim-fep.c
===================================================================
--- trunk/fep/uim-fep.c	2005-02-11 18:50:43 UTC (rev 634)
+++ trunk/fep/uim-fep.c	2005-02-12 15:43:29 UTC (rev 635)
@@ -212,8 +212,8 @@
     FALSE,     /* standout */
     FALSE,     /* bold */
     FALSE,     /* blink */
-    FALSE,     /* foreground */
-    FALSE      /* background */
+    UNDEFINED, /* foreground */
+    UNDEFINED  /* background */
   };
 
   tcflag_t save_iflag;
@@ -330,6 +330,13 @@
     return EXIT_FAILURE;
   }
 
+  if (attr_uim.foreground == UNDEFINED) {
+    attr_uim.foreground = FALSE;
+  }
+  if (attr_uim.background == UNDEFINED) {
+    attr_uim.background = FALSE;
+  }
+
   if (s_gnu_screen) {
     s_status_type = BACKTICK;
     s_master = PROC_FILENO;
@@ -832,8 +839,6 @@
 static void recover(int sig_no)
 {
   put_exit_attribute_mode();
-  put_exit_standout_mode();
-  put_exit_underline_mode();
   put_restore_cursor();
   put_cursor_normal();
   recover_loop();



More information about the Uim-commit mailing list