improve the method naming for "mark new word position", move the mark operation out of bookmarkEditPosition up one level to LFUN_SELF_INSERT of the text inset dispatch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38181 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stephan Witt 2011-04-01 05:49:04 +00:00
parent 7b3762cd69
commit 934cadd381
4 changed files with 6 additions and 6 deletions

View File

@ -700,7 +700,6 @@ CursorStatus BufferView::cursorStatus(DocIterator const & dit) const
void BufferView::bookmarkEditPosition()
{
d->cursor_.markEditPosition();
// Don't eat cpu time for each keystroke
if (d->cursor_.paragraph().id() == d->bookmark_edit_position_)
return;

View File

@ -518,14 +518,14 @@ void Cursor::setCursorToAnchor()
}
void Cursor::markEditPosition()
void Cursor::markNewWordPosition()
{
if (lyxrc.spellcheck_continuously && inTexted() && new_word_.empty()) {
FontSpan ow = locateWord(WHOLE_WORD);
if (ow.size() == 1) {
FontSpan nw = locateWord(WHOLE_WORD);
if (nw.size() == 1) {
LYXERR(Debug::DEBUG, "start new word: "
<< " par: " << pit()
<< " pos: " << ow.first);
<< " pos: " << nw.first);
new_word_ = *this;
}
}

View File

@ -293,7 +293,7 @@ public:
void checkBufferStructure();
/// hook for text input to maintain the "new born word"
void markEditPosition();
void markNewWordPosition();
/// The position of the new born word
/// As the user is entering a word without leaving it

View File

@ -1552,6 +1552,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
cur.resetAnchor();
moveCursor(cur, false);
cur.markNewWordPosition();
bv->bookmarkEditPosition();
break;
}