// Therefore, it should only be used for breaking and merging paragraphs
// We need a copy here because the character at fromPos is going to be erased.
- Font const & tmpFont = fromPar.getFontSettings(params, fromPos);
- Change const & tmpChange = fromPar.lookupChange(fromPos);
+ Font const tmpFont = fromPar.getFontSettings(params, fromPos);
+ Change const tmpChange = fromPar.lookupChange(fromPos);
if (Inset * tmpInset = fromPar.getInset(fromPos)) {
fromPar.releaseInset(fromPos);
Text::Text(InsetText * owner, bool use_default_layout)
- : owner_(owner), autoBreakRows_(false), undo_counter_(0)
+ : owner_(owner), autoBreakRows_(false)
{
pars_.push_back(Paragraph());
Paragraph & par = pars_.back();
Text::Text(InsetText * owner, Text const & text)
- : owner_(owner), autoBreakRows_(text.autoBreakRows_), undo_counter_(0)
+ : owner_(owner), autoBreakRows_(text.autoBreakRows_)
{
pars_ = text.pars_;
ParagraphList::iterator const end = pars_.end();
} else if (token == "\\color") {
lex.next();
setLyXColor(lex.getString(), font.fontInfo());
- } else if (token == "\\SpecialChar") {
+ } else if (token == "\\SpecialChar" ||
+ (token == "\\SpecialCharNoPassThru" &&
+ !par.layout().pass_thru && !inset().isPassThru())) {
auto_ptr<Inset> inset;
inset.reset(new InsetSpecialChar);
inset->read(lex);
inset->setBuffer(*buf);
par.insertInset(par.size(), inset.release(), font, change);
+ } else if (token == "\\SpecialCharNoPassThru") {
+ lex.next();
+ docstring const s = ltrim(lex.getDocString(), "\\");
+ par.insert(par.size(), s, font, change);
} else if (token == "\\IPAChar") {
auto_ptr<Inset> inset;
inset.reset(new InsetIPAChar);
Layout const & layout(par.layout());
FontInfo info = font.fontInfo();
info.realize(layout.resfont);
- if (layout.pass_thru || info.family() == TYPEWRITER_FAMILY) {
+ if (layout.pass_thru || inset().isPassThru() ||
+ info.family() == TYPEWRITER_FAMILY) {
if (token == "\\twohyphens")
par.insert(par.size(), from_ascii("--"), font, change);
else
{
Paragraph & par = cur.paragraph();
- // Here we call finishUndo for every 20 characters inserted.
- // This is from my experience how emacs does it. (Lgb)
- if (undo_counter_ < 20) {
- ++undo_counter_;
- } else {
- cur.finishUndo();
- undo_counter_ = 0;
- }
-
// register word if a non-letter was entered
if (cur.pos() > 1
&& !par.isWordSeparator(cur.pos() - 2)
// Store the characters to be transposed (including font information).
char_type const char1 = par.getChar(pos1);
- Font const & font1 =
+ Font const font1 =
par.getFontSettings(cur.buffer()->params(), pos1);
char_type const char2 = par.getChar(pos2);
- Font const & font2 =
+ Font const font2 =
par.getFontSettings(cur.buffer()->params(), pos2);
// And finally, we are ready to perform the transposition.