updateVisibility(cur, start, keep);
- if (cur.result().screenUpdate())
- gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
// 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
showPopup(cur);
// redraw if needed
- if (cur.result().screenUpdate())
- gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
showInline(cur);
// redraw if needed
- if (cur.result().screenUpdate())
- gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
hideInline(cur);
// redraw if needed
- if (cur.result().screenUpdate())
- gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
void GuiCompleter::tab()
{
- BufferView * bv = &gui_->bufferView();
- Cursor cur = bv->cursor();
+ BufferView & bv = gui_->bufferView();
+ Cursor cur = bv.cursor();
cur.screenUpdateFlags(Update::None);
// check that inline completion is active
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);
hidePopup();
hideInline(cur);
updateVisibility(false, false);
+
+ // redraw if needed
+ bv.processUpdateFlags(cur.result().screenUpdate());
return;
}
docstring nextchar = completion.substr(prefix.size(), 1);
docstring longestCompletion = longestUniqueCompletion();
prefix = cur.inset().completionPrefix(cur);
docstring postfix = longestCompletion.substr(min(longestCompletion.size(), prefix.size()));
- cur.inset().insertCompletion(cur, postfix, false);
- old_cursor_ = bv->cursor();
+ cur.inset().insertCompletion(cur, postfix, uniqueCompletionAvailable());
+ old_cursor_ = bv.cursor();
updatePrefix(cur);
// show popup without delay because the completion was not unique
popup_timer_.start(0);
// redraw if needed
- if (cur.result().screenUpdate())
- gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ bv.processUpdateFlags(cur.result().screenUpdate());
}
hidePopup();
hideInline(cur);
- if (cur.result().screenUpdate())
- gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
cur.endUndoGroup();
}
if (inlineVisible())
updateInline(cur, completion);
- if (cur.result().screenUpdate())
- gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
} // namespace frontend