[Aptitude-svn-commit] r3595 - in branches/aptitude-0.3/aptitude: . src/vscreen

Daniel Burrows dburrows@costa.debian.org
Sun Jul 3 18:37:48 UTC 2005


Author: dburrows
Date: Sun Jul  3 18:37:46 2005
New Revision: 3595

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/vs_pager.cc
Log:
Fix wide-character support in the pager.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sun Jul  3 18:37:46 2005
@@ -1,5 +1,11 @@
 2005-07-03  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/vs_pager.cc:
+
+	  Actually support wide characters in the pager: calculate
+	  widths correctly and use wide character output routines
+	  (so characters don't get randomly degraded to ASCII..oops!)
+
 	* README.i18n:
 
 	  Document the existence of encoding translations.

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_pager.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_pager.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_pager.cc	Sun Jul  3 18:37:46 2005
@@ -81,7 +81,7 @@
 	  if(s[loc]==L'\t')
 	    cur_width+=8;
 	  else
-	    ++cur_width;
+	    cur_width+=wcwidth(s[loc]);
 
 	  curline+=s[loc];
 
@@ -269,8 +269,10 @@
 	    x+=8;
 	  else if(x>=first_column)
 	    {
-	      mvaddch(y, x-first_column, (unsigned char) s[curr]);
-	      ++x;
+	      wchar_t ch=s[curr];
+
+	      mvadd_wch(y, x-first_column, ch);
+	      x+=wcwidth(ch);
 	    }
 	  else
 	    ++x;




More information about the Aptitude-svn-commit mailing list