*** empty log message ***
authorroot <root>
Tue, 4 Nov 2008 15:02:35 +0000 (15:02 +0000)
committerroot <root>
Tue, 4 Nov 2008 15:02:35 +0000 (15:02 +0000)
Changes
src/screen.C

diff --git a/Changes b/Changes
index 4d1106f725bee510636faf9be55a62b9cdd2f787..9fa7495d40fff979c72df9b6f703b3dc7e90efc2 100644 (file)
--- a/Changes
+++ b/Changes
@@ -29,6 +29,8 @@ TODO: cursor over overlays, when focus change?
           when a window was closed.
         - do not (wrongly) adjust the virtual line length inside
           scr_insdel_chars/ERASE (Miroslav Lichvar).
+        - fix an issue where wide tab characters caused character shifts
+          when part of them was deleted (tracked down by Miroslav Lichvar).
        - remove bogus "setuid/setgid security issues" from rxvt.1.pod, they
           no longer apply.
         - the urgency hint is now cleared on both focus in and focus out.
index 0e05a0565e7094d90e1314055114f93d67ff9225..6716e41313cebd9a7d53ac350b6eb73fbe5b73cc 100644 (file)
@@ -145,7 +145,7 @@ rxvt_term::scr_kill_char (line_t &l, int col) const NOTHROW
   rend_t rend = l.r[col] & ~RS_baseattrMask;
   rend = SET_FONT (rend, FONTSET (rend)->find_font (' '));
 
-  // found begin, nuke
+  // found start, nuke
   do {
     l.t[col] = ' ';
     l.r[col] = rend;
@@ -1466,7 +1466,7 @@ rxvt_term::scr_insdel_chars (int count, int insdel) NOTHROW
   line->touch ();
   line->is_longer (0);
 
-  // nuke wide char at beginning
+  // nuke wide spanning the start
   if (line->t[screen.cur.col] == NOCHAR)
     scr_kill_char (*line, screen.cur.col);
 
@@ -1515,38 +1515,35 @@ rxvt_term::scr_insdel_chars (int count, int insdel) NOTHROW
         break;
 
       case DELETE:
-        {
-          line->l = max (line->l - count, 0);
-
-          rend_t tr = line->r[ncol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask);
+        line->l = max (line->l - count, 0);
 
-          for (int col = screen.cur.col; (col + count) < ncol; col++)
-            {
-              line->t[col] = line->t[col + count];
-              line->r[col] = line->r[col + count];
-            }
+        // nuke wide char spanning the end
+        if (screen.cur.col + count < ncol && line->t[screen.cur.col + count] == NOCHAR)
+          scr_kill_char (*line, screen.cur.col + count);
 
-          // nuke wide char at the end
-          if (line->t[screen.cur.col] == NOCHAR)
-            scr_kill_char (*line, screen.cur.col);
+        for (int col = screen.cur.col; (col + count) < ncol; col++)
+          {
+            line->t[col] = line->t[col + count];
+            line->r[col] = line->r[col + count];
+          }
 
-          scr_blank_line (*line, ncol - count, count, tr);
+        scr_blank_line (*line, ncol - count, count,
+                        line->r[ncol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask));
 
-          if (selection.op && current_screen == selection.screen
-              && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur))
-            {
-              if (selection.end.row != screen.cur.row
-                  || (screen.cur.col >= selection.beg.col - count)
-                  || selection.end.col >= ncol)
-                CLEAR_SELECTION ();
-              else
-                {
-                  /* shift selection */
-                  selection.beg.col  -= count;
-                  selection.mark.col -= count; /* XXX: yes? */
-                  selection.end.col  -= count;
-                }
-            }
+        if (selection.op && current_screen == selection.screen
+            && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur))
+          {
+            if (selection.end.row != screen.cur.row
+                || (screen.cur.col >= selection.beg.col - count)
+                || selection.end.col >= ncol)
+              CLEAR_SELECTION ();
+            else
+              {
+                /* shift selection */
+                selection.beg.col  -= count;
+                selection.mark.col -= count; /* XXX: yes? */
+                selection.end.col  -= count;
+              }
           }
 
         break;