- if (!dr.dispatched()) {
- Cursor old = bv->cursor();
- bv->cursor().dispatch(cmd);
-
- // notify insets we just left
- // FIXME: move this code to Cursor::dispatch
- if (bv->cursor() != old) {
- old.beginUndoGroup();
- old.fixIfBroken();
- bool badcursor = notifyCursorLeavesOrEnters(old, bv->cursor());
- if (badcursor) {
- bv->cursor().fixIfBroken();
- bv->fixInlineCompletionPos();
- }
- old.endUndoGroup();
- }
-
- // update completion. We do it here and not in
- // processKeySym to avoid another redraw just for a
- // changed inline completion
- if (cmd.origin() == FuncRequest::KEYBOARD) {
- if (cmd.action() == LFUN_SELF_INSERT
- || (cmd.action() == LFUN_ERT_INSERT && bv->cursor().inMathed()))
- updateCompletion(bv->cursor(), true, true);
- else if (cmd.action() == LFUN_CHAR_DELETE_BACKWARD)
- updateCompletion(bv->cursor(), false, true);
- else
- updateCompletion(bv->cursor(), false, false);
- }
-
- dr = bv->cursor().result();
+ bv->cursor().dispatch(cmd);
+
+ // update completion. We do it here and not in
+ // processKeySym to avoid another redraw just for a
+ // changed inline completion
+ if (cmd.origin() == FuncRequest::KEYBOARD) {
+ if (cmd.action() == LFUN_SELF_INSERT
+ || (cmd.action() == LFUN_ERT_INSERT && bv->cursor().inMathed()))
+ updateCompletion(bv->cursor(), true, true);
+ else if (cmd.action() == LFUN_CHAR_DELETE_BACKWARD)
+ updateCompletion(bv->cursor(), false, true);
+ else
+ updateCompletion(bv->cursor(), false, false);