Limit selection in completion popup to boxes containing less than completion_change_to_ascii_sorting items

This commit is contained in:
Charles Haley 2012-07-02 16:00:30 +02:00
parent 1d9285df7a
commit 7b502b06f7

View File

@ -168,12 +168,13 @@ class MultiCompleteComboBox(EnComboBox):
v = unicode(c.currentCompletion()) v = unicode(c.currentCompletion())
c.setCompletionPrefix('') c.setCompletionPrefix('')
c.complete() c.complete()
if c.model().rowCount() < tweaks['completion_change_to_ascii_sorting']:
i = 0; i = 0;
while c.setCurrentRow(i): while c.setCurrentRow(i):
cr = unicode(c.currentIndex().data().toString()) cr = unicode(c.currentIndex().data().toString())
if cr.startswith(v): if cr.startswith(v):
c.popup().setCurrentIndex(c.currentIndex()) c.popup().setCurrentIndex(c.currentIndex())
return break
i += 1 i += 1
def update_items_cache(self, complete_items): def update_items_cache(self, complete_items):