X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiCompleter.cpp;h=661178575b1f860e2a71ce82bedd42dd5470456f;hb=8863d6d785358680d05b4b34b35ca09a15cccb82;hp=a40bdca1a48f200a6740b4428aff1b74a17c4633;hpb=b6010badfa9d055147c653615ab5e0c571592797;p=lyx.git diff --git a/src/frontends/qt/GuiCompleter.cpp b/src/frontends/qt/GuiCompleter.cpp index a40bdca1a4..661178575b 100644 --- a/src/frontends/qt/GuiCompleter.cpp +++ b/src/frontends/qt/GuiCompleter.cpp @@ -455,8 +455,8 @@ void GuiCompleter::asyncUpdatePopup() // has a bad memory about it and we have to tell him again and again. QTreeView * listView = static_cast(popup()); listView->header()->setStretchLastSection(false); - setSectionResizeMode(listView->header(), 0, QHeaderView::Stretch); - setSectionResizeMode(listView->header(), 1, QHeaderView::Fixed); + listView->header()->setSectionResizeMode(0, QHeaderView::Stretch); + listView->header()->setSectionResizeMode(1, QHeaderView::Fixed); listView->header()->resizeSection(1, 22); // show/update popup @@ -682,9 +682,8 @@ void GuiCompleter::tab() return; } - // Make undo possible + // Prepare for undo (recordUndo is invoked in the insets' insertCompletion methods) UndoGroupHelper ugh(cur.buffer()); - cur.recordUndo(); // If completion is active, at least complete by one character docstring prefix = cur.inset().completionPrefix(cur); @@ -711,7 +710,7 @@ void GuiCompleter::tab() docstring longestCompletion = longestUniqueCompletion(); prefix = cur.inset().completionPrefix(cur); docstring postfix = longestCompletion.substr(min(longestCompletion.size(), prefix.size())); - cur.inset().insertCompletion(cur, postfix, false); + cur.inset().insertCompletion(cur, postfix, uniqueCompletionAvailable()); old_cursor_ = bv.cursor(); updatePrefix(cur);