#include <QApplication>
#include <QHeaderView>
+#include <QKeyEvent>
#include <QPainter>
#include <QPixmapCache>
#include <QScrollBar>
model_ = new GuiCompletionModel(this, 0);
setModel(model_);
setCompletionMode(QCompleter::PopupCompletion);
- setCaseSensitivity(Qt::CaseInsensitive);
+ setCaseSensitivity(Qt::CaseSensitive);
setWidget(gui_);
// create the popup
if (!inlineVisible() && possibleInlineState && start
&& cur.inset().automaticInlineCompletion())
inline_timer_.start(int(lyxrc.completion_inline_delay * 1000));
- else {
+ else if (cur.inMathed() && !lyxrc.completion_inline_math) {
// no inline completion, hence a metrics update is needed
- if (!(cur.result().update() & Update::Force))
- cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
+ if (!(cur.result().screenUpdate() & Update::Force))
+ cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
}
// update prefix if any completion is possible
updateVisibility(cur, start, keep);
- if (cur.result().update())
- gui_->bufferView().processUpdateFlags(cur.result().update());
+ if (cur.result().screenUpdate())
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
showPopup(cur);
// redraw if needed
- if (cur.result().update())
- gui_->bufferView().processUpdateFlags(cur.result().update());
+ if (cur.result().screenUpdate())
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
showInline(cur);
// redraw if needed
- if (cur.result().update())
- gui_->bufferView().processUpdateFlags(cur.result().update());
+ if (cur.result().screenUpdate())
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
hidePopup(cur);
// redraw if needed
- if (cur.result().update())
- gui_->bufferView().processUpdateFlags(cur.result().update());
+ if (cur.result().screenUpdate())
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
hideInline(cur);
// redraw if needed
- if (cur.result().update())
- gui_->bufferView().processUpdateFlags(cur.result().update());
+ if (cur.result().screenUpdate())
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
}
// Make undo possible
+ cur.beginUndoGroup();
cur.recordUndo();
// If completion is active, at least complete by one character
hidePopup(cur);
hideInline(cur);
updateVisibility(false, false);
+ cur.endUndoGroup();
return;
}
docstring nextchar = completion.substr(prefix.size(), 1);
- if (!cur.inset().insertCompletion(cur, nextchar, false))
+ if (!cur.inset().insertCompletion(cur, nextchar, false)) {
+ cur.endUndoGroup();
return;
+ }
updatePrefix(cur);
// try to complete as far as it is unique
popup_timer_.start(0);
// redraw if needed
- if (cur.result().update())
- gui_->bufferView().processUpdateFlags(cur.result().update());
+ if (cur.result().screenUpdate())
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ cur.endUndoGroup();
}
{
Cursor cur = gui_->bufferView().cursor();
cur.screenUpdateFlags(Update::None);
-
+
+ cur.beginUndoGroup();
cur.recordUndo();
docstring prefix = cur.inset().completionPrefix(cur);
hidePopup(cur);
hideInline(cur);
- if (cur.result().update())
- gui_->bufferView().processUpdateFlags(cur.result().update());
+ if (cur.result().screenUpdate())
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+ cur.endUndoGroup();
}
if (inlineVisible())
updateInline(cur, completion);
- if (cur.result().update())
- gui_->bufferView().processUpdateFlags(cur.result().update());
+ if (cur.result().screenUpdate())
+ gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
}
} // namespace frontend