#include "SpellChecker.h"
#include "TextClass.h"
#include "TextMetrics.h"
-#include "VSpace.h"
#include "WordLangTuple.h"
#include "frontends/Application.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
+#include "support/lassert.h"
#include "support/lstrings.h"
#include "support/lyxtime.h"
#include "support/os.h"
using cap::replaceSelection;
using cap::grabAndEraseSelection;
using cap::selClearOrDel;
+using cap::pasteSimpleText;
// globals...
static Font freefont(ignore_font, ignore_language);
if (edit)
inset->edit(cur, true);
// Now put this into inset
- cur.text()->insertStringAsLines(cur, ds, Font(inherit_font));
- cur.leaveInset(*inset);
+ Font const f(inherit_font, cur.current_font.language());
+ if (!ds.empty()) {
+ cur.text()->insertStringAsLines(cur, ds, f);
+ cur.leaveInset(*inset);
+ }
return true;
}
// provide it with two different cursors.
Cursor dummy = cur;
dummy.pos() = dummy.pit() = 0;
- if (cur.bv().checkDepm(dummy, cur))
+ if (cur.bv().checkDepm(dummy, cur)) {
cur.forceBufferUpdate();
+ // DEPM may have requested a screen update
+ cur.screenUpdateFlags(
+ cur.screenUpdate() | dummy.screenUpdate());
+ }
}
}
break;
Cursor dummy = cur;
dummy.pos() = cur.lastpos();
dummy.pit() = cur.lastpit();
- if (cur.bv().checkDepm(dummy, cur))
+ if (cur.bv().checkDepm(dummy, cur)) {
cur.forceBufferUpdate();
+ // DEPM may have requested a screen update
+ cur.screenUpdateFlags(
+ cur.screenUpdate() | dummy.screenUpdate());
+ }
}
}
break;
// provide it with two different cursors.
Cursor dummy = cur;
dummy.pos() = dummy.pit() = 0;
- if (cur.bv().checkDepm(dummy, cur))
+ if (cur.bv().checkDepm(dummy, cur)) {
cur.forceBufferUpdate();
+ // DEPM may have requested a screen update
+ cur.screenUpdateFlags(
+ cur.screenUpdate() | dummy.screenUpdate());
+ }
}
}
break;
Cursor dummy = cur;
dummy.pos() = cur.lastpos();
dummy.pit() = cur.lastpit();
- if (cur.bv().checkDepm(dummy, cur))
+ if (cur.bv().checkDepm(dummy, cur)) {
cur.forceBufferUpdate();
+ // DEPM may have requested a screen update
+ cur.screenUpdateFlags(
+ cur.screenUpdate() | dummy.screenUpdate());
+ }
}
}
break;
bv->buffer().errors("Paste");
break;
+ case LFUN_CLIPBOARD_PASTE_SIMPLE:
+ cur.clearSelection();
+ pasteSimpleText(cur, cmd.argument() == "paragraph");
+ break;
+
case LFUN_PRIMARY_SELECTION_PASTE:
pasteString(cur, theSelection().get(),
cmd.argument() == "paragraph");
cur.resetAnchor();
moveCursor(cur, false);
+ cur.markNewWordPosition();
bv->bookmarkEditPosition();
break;
}
Language const * lang = languages.getLanguage(to_utf8(cmd.argument()));
if (!lang)
break;
- if (!cur.selection()) {
- // apply to current word
- selectWordWhenUnderCursor(cur, WHOLE_WORD);
- }
+ selectWordWhenUnderCursor(cur, WHOLE_WORD_STRICT);
Font font(ignore_font, lang);
- toggleAndShow(cur, this, font);
+ toggleAndShow(cur, this, font, false);
break;
}
// make sure we know about such floats
if (cit == floats.end() ||
// and that we know how to generate a list of them
- (!cit->second.needsFloatPkg() && cit->second.listCommand().empty())) {
+ (!cit->second.usesFloatPkg() && cit->second.listCommand().empty())) {
flag.setUnknown(true);
// probably not necessary, but...
enable = false;
}
case LFUN_CLIPBOARD_PASTE:
+ case LFUN_CLIPBOARD_PASTE_SIMPLE:
enable = !theClipboard().empty();
break;