Browse Source

more comments for wchar problem

Matthew Wang 11 years ago
parent
commit
e2dbc3a12e
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      src/cdiff.py

+ 6
- 2
src/cdiff.py View File

172
                     out.append(patt.sub(r'\1', markup))
172
                     out.append(patt.sub(r'\1', markup))
173
                     markup = patt.sub(r'\3', markup)
173
                     markup = patt.sub(r'\3', markup)
174
                 else:
174
                 else:
175
-                    # FIXME: utf-8 wchar broken here
175
+                    # FIXME: utf-8 wchar might break the rule here, e.g.
176
+                    # u'\u554a' takes double width of a single letter, also this
177
+                    # depends on your terminal font.  I guess audience of this
178
+                    # tool never put that kind of symbol in their code :-)
179
+                    #
176
                     out.append(markup[0])
180
                     out.append(markup[0])
177
-                    markup = markup[1:]
178
                     count += 1
181
                     count += 1
182
+                    markup = markup[1:]
179
 
183
 
180
             if count == width and repl.sub('', markup):
184
             if count == width and repl.sub('', markup):
181
                 # stripped: output fulfil and still have ascii in markup
185
                 # stripped: output fulfil and still have ascii in markup