// has a bad memory about it and we have to tell him again and again.
QTreeView * listView = static_cast<QTreeView *>(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
void GuiCompleter::tab()
{
- BufferView const & bv = gui_->bufferView();
+ BufferView & bv = gui_->bufferView();
Cursor cur = bv.cursor();
cur.screenUpdateFlags(Update::None);
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);
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);