pyreadline: patch from pan to remove cursor flickering when inputting chinese characters

This commit is contained in:
jstenar
2007-11-20 18:59:58 +00:00
parent b1bae5d69f
commit a4f98cccb2
5 changed files with 20 additions and 11 deletions
+5 -4
View File
@@ -14,6 +14,7 @@ import pyreadline.lineeditor.lineobj as lineobj
import pyreadline.lineeditor.history as history
import pyreadline.clipboard as clipboard
from pyreadline.error import ReadlineError,GetSetError
from pyreadline.unicode_helper import ensure_str, ensure_unicode
in_ironpython="IronPython" in sys.version
class BaseMode(object):
@@ -127,12 +128,12 @@ class BaseMode(object):
if buf[self.begidx] in self.completer_delims:
self.begidx += 1
break
text = ''.join(buf[self.begidx:self.endidx])
text = ensure_str(''.join(buf[self.begidx:self.endidx]))
log('complete text="%s"' % text)
i = 0
while 1:
try:
r = self.completer(text, i)
r = ensure_unicode(self.completer(text, i))
except:
break
i += 1
@@ -148,9 +149,9 @@ class BaseMode(object):
if buf[self.begidx] in ' \t\n':
self.begidx += 1
break
text = ''.join(buf[self.begidx:self.endidx])
text = ensure_str(''.join(buf[self.begidx:self.endidx]))
log('file complete text="%s"' % text)
completions = glob.glob(os.path.expanduser(text) + '*')
completions = map(ensure_unicode, glob.glob(os.path.expanduser(text) + '*'))
if self.mark_directories == 'on':
mc = []
for f in completions: