*/
-void BufferView::Pimpl::moveCursorUpdate(bool selecting, bool fitcur)
-{
- LyXText * lt = bv_->getLyXText();
-
- if (selecting || lt->selection.mark()) {
- lt->setSelection(bv_);
- if (lt->bv_owner)
- toggleToggle();
- else
- updateInset(lt->inset_owner, false);
- }
- if (lt->bv_owner) {
- if (fitcur)
- update(lt, BufferView::SELECT|BufferView::FITCUR);
- else
- update(lt, BufferView::SELECT);
- showCursor();
- } else if (bv_->text->status() != LyXText::UNCHANGED) {
- bv_->theLockingInset()->hideInsetCursor(bv_);
- update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
- showCursor();
- }
-
- if (!lt->selection.set())
- workarea().haveSelection(false);
-
- switchKeyMap();
-}
-
-
Inset * BufferView::Pimpl::getInsetByCode(Inset::Code code)
{
#if 0
namespace {
- void finishChange(BufferView * bv, bool fitcur = false)
+ void moveCursorUpdate(BufferView * bv, bool selecting)
+ {
+ LyXText * lt = bv->getLyXText();
+
+ if (selecting || lt->selection.mark()) {
+ lt->setSelection(bv);
+ if (lt->bv_owner)
+ bv->toggleToggle();
+ else
+ bv->updateInset(lt->inset_owner, false);
+ }
+ if (lt->bv_owner) {
+ //if (fitcur)
+ // bv->update(lt, BufferView::SELECT|BufferView::FITCUR);
+ //else
+ bv->update(lt, BufferView::SELECT);
+ bv->showCursor();
+ } else if (bv->text->status() != LyXText::UNCHANGED) {
+ bv->theLockingInset()->hideInsetCursor(bv);
+ bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
+ bv->showCursor();
+ }
+
+ if (!lt->selection.set())
+ bv->workarea().haveSelection(false);
+
+ bv->switchKeyMap();
+ }
+
+
+ void finishChange(BufferView * bv, bool selecting = false)
{
finishUndo();
- bv->moveCursorUpdate(fitcur);
+ moveCursorUpdate(bv, selecting);
bv->owner()->view_state_changed();
}
finishChange(bv, false);
// was:
// finishUndo();
- // moveCursorUpdate(false, false);
+ // moveCursorUpdate(bv, false, false);
// owner_->view_state_changed();
break;
insertChar(bv, Paragraph::META_NEWLINE);
update(bv, true);
setCursor(bv, cursor.par(), cursor.pos());
- bv->moveCursorUpdate(false);
+ moveCursorUpdate(bv, false);
break;
case LFUN_DELETE:
cutSelection(bv, true);
update(bv);
}
- bv->moveCursorUpdate(false);
+ moveCursorUpdate(bv, false);
bv->owner()->view_state_changed();
bv->switchKeyMap();
break;
} else {
specialChar(this, bv, InsetSpecialChar::PROTECTED_SEPARATOR);
}
- bv->moveCursorUpdate(false);
+ moveCursorUpdate(bv, false);
break;
case LFUN_HYPHENATION:
// this was originally a beforeChange(bv->text), i.e
// the outermost LyXText!
bv->beforeChange(this);
- string const clip(bv->workarea().getClipboard());
+ string const clip = bv->workarea().getClipboard();
if (!clip.empty()) {
if (cmd.argument == "paragraph")
insertStringAsParagraphs(bv, clip);
Paragraph const * par = cursor.par();
lyx::pos_type pos = cursor.pos();
char c;
-
if (!pos)
c = ' ';
else if (par->isInset(pos - 1) && par->getInset(pos - 1)->isSpace())
update(bv, true);
}
selection.cursor = cursor;
- bv->moveCursorUpdate(false);
+ moveCursorUpdate(bv, false);
break;
}
update(bv);
selection.cursor = cursor;
- bv->moveCursorUpdate(false);
+ moveCursorUpdate(bv, false);
// real_current_font.number can change so we need to
// update the minibuffer