#include "Language.h"
#include "Length.h"
#include "Lexer.h"
+#include "lyxfind.h"
#include "LyXRC.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"
else
lex.printError("Unknown bar font flag "
"`$$Token'");
+ } else if (token == "\\strikeout") {
+ lex.next();
+ font.fontInfo().setStrikeout(font.setLyXMisc(lex.getString()));
+ } else if (token == "\\uuline") {
+ lex.next();
+ font.fontInfo().setUuline(font.setLyXMisc(lex.getString()));
+ } else if (token == "\\uwave") {
+ lex.next();
+ font.fontInfo().setUwave(font.setLyXMisc(lex.getString()));
} else if (token == "\\noun") {
lex.next();
font.fontInfo().setNoun(font.setLyXMisc(lex.getString()));
&& !par.isLetter(cur.pos() - 1)) {
// get the word in front of cursor
LASSERT(this == cur.text(), /**/);
- cur.paragraph().updateWords(cur.top());
+ cur.paragraph().updateWords();
}
}
{
LASSERT(this == cur.text(), /**/);
- if (!cur.selection())
- return;
+ if (!cur.selection()) {
+ Change const & change = cur.paragraph().lookupChange(cur.pos());
+ if (!(change.changed() && findNextChange(&cur.bv())))
+ return;
+ }
cur.recordUndoSelection();
void Text::getWord(CursorSlice & from, CursorSlice & to,
word_location const loc) const
{
- Paragraph const & from_par = pars_[from.pit()];
- switch (loc) {
- case WHOLE_WORD_STRICT:
- if (from.pos() == 0 || from.pos() == from_par.size()
- || !from_par.isLetter(from.pos())
- || !from_par.isLetter(from.pos() - 1)) {
- to = from;
- return;
- }
- // no break here, we go to the next
-
- case WHOLE_WORD:
- // If we are already at the beginning of a word, do nothing
- if (!from.pos() || !from_par.isLetter(from.pos() - 1))
- break;
- // no break here, we go to the next
-
- case PREVIOUS_WORD:
- // always move the cursor to the beginning of previous word
- while (from.pos() && from_par.isLetter(from.pos() - 1))
- --from.pos();
- break;
- case NEXT_WORD:
- LYXERR0("Text::getWord: NEXT_WORD not implemented yet");
- break;
- case PARTIAL_WORD:
- // no need to move the 'from' cursor
- break;
- }
to = from;
- Paragraph const & to_par = pars_[to.pit()];
- while (to.pos() < to_par.size() && to_par.isLetter(to.pos()))
- ++to.pos();
+ pars_[to.pit()].locateWord(from.pos(), to.pos(), loc);
}
// register the words in the global word list
CursorSlice sl = CursorSlice(*insetPtr);
sl.pit() = pars_.size() - 1;
- pars_.back().updateWords(sl);
+ pars_.back().updateWords();
} else if (token == "\\begin_deeper") {
++depth;
} else if (token == "\\end_deeper") {