Changeset 27564
- Timestamp:
- 11/16/08 18:02:40 (2 months ago)
- Files:
-
- lyx-devel/trunk/src/frontends/qt4/GuiCompleter.cpp (modified) (5 diffs)
- lyx-devel/trunk/src/frontends/qt4/GuiCompleter.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lyx-devel/trunk/src/frontends/qt4/GuiCompleter.cpp
r27561 r27564 235 235 236 236 237 bool GuiCompleter::uniqueCompletionAvailable() const 238 { 239 if (!modelActive_) 240 return false; 241 242 size_t n = popup()->model()->rowCount(); 243 if (n > 1 || n == 0) 244 return false; 245 246 // if there is exactly one, we have to check whether it is a 247 // real completion, i.e. longer than the current prefix. 248 if (completionPrefix() == currentCompletion()) 249 return false; 250 251 return true; 252 } 253 254 237 255 bool GuiCompleter::completionAvailable() const 238 256 { … … 639 657 640 658 // check that inline completion is active 641 if (!inlineVisible() ) {659 if (!inlineVisible() && !uniqueCompletionAvailable()) { 642 660 // try to activate the inline completion 643 661 if (cur.inset().inlineCompletionSupported(cur)) { … … 661 679 } 662 680 681 // Make undo possible 682 cur.recordUndo(); 683 663 684 // If completion is active, at least complete by one character 664 685 docstring prefix = cur.inset().completionPrefix(cur); … … 803 824 return docstring(); 804 825 QString s = model.data(model.index(0, 0), Qt::EditRole).toString(); 805 826 806 827 if (modelSorting() == QCompleter::UnsortedModel) { 807 828 // For unsorted model we cannot do more than iteration. … … 852 873 cur.updateFlags(Update::None); 853 874 875 cur.recordUndo(); 876 854 877 docstring prefix = cur.inset().completionPrefix(cur); 855 878 docstring postfix = qstring_to_ucs4(completion.mid(prefix.length())); lyx-devel/trunk/src/frontends/qt4/GuiCompleter.h
r25108 r27564 71 71 /// 72 72 docstring longestUniqueCompletion() const; 73 /// 74 bool uniqueCompletionAvailable() const; 73 75 74 76 public Q_SLOTS:
