mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 11:52:25 +00:00
Don't restart the blinking cursor inside WorkArea because some shortcuts can delete the current WorkArea.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20900 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9f60651fcb
commit
59aae2aa83
@ -314,6 +314,17 @@ void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
void restartCursor(LyXView * lv)
|
||||
{
|
||||
/* When we move around, or type, it's nice to be able to see
|
||||
* the cursor immediately after the keypress.
|
||||
*/
|
||||
if (lv && lv->currentWorkArea())
|
||||
lv->currentWorkArea()->startBlinkingCursor();
|
||||
}
|
||||
}
|
||||
|
||||
void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
||||
{
|
||||
LYXERR(Debug::KEY) << "KeySym is " << keysym.getSymbolName() << endl;
|
||||
@ -322,11 +333,13 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
||||
if (!keysym.isOK()) {
|
||||
LYXERR(Debug::KEY) << "Empty kbd action (probably composing)"
|
||||
<< endl;
|
||||
restartCursor(lyx_view_);
|
||||
return;
|
||||
}
|
||||
|
||||
if (keysym.isModifier()) {
|
||||
LYXERR(Debug::KEY) << "isModifier true" << endl;
|
||||
restartCursor(lyx_view_);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -396,6 +409,7 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
||||
} else {
|
||||
LYXERR(Debug::KEY) << "Unknown, !isText() - giving up" << endl;
|
||||
lyx_view_->message(_("Unknown function."));
|
||||
restartCursor(lyx_view_);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -411,6 +425,8 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
||||
} else {
|
||||
dispatch(func);
|
||||
}
|
||||
|
||||
restartCursor(lyx_view_);
|
||||
}
|
||||
|
||||
|
||||
|
@ -171,11 +171,6 @@ void WorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
|
||||
|
||||
theLyXFunc().setLyXView(lyx_view_);
|
||||
theLyXFunc().processKeySym(key, mod);
|
||||
|
||||
/* When we move around, or type, it's nice to be able to see
|
||||
* the cursor immediately after the keypress.
|
||||
*/
|
||||
startBlinkingCursor();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user