mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 06:57:01 +00:00
KeyMap is now switched (if necessary) only just before it is actually used
for translating keystrokes. Up until now, the switching was done in advance in all kinds of situations, but not just before translating was actually done --- which resulted in the KeyMap not always being switched on time... This solves bug #3811 (http://bugzilla.lyx.org/show_bug.cgi?id=3811) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18744 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
82c2fbf81a
commit
6742e42e79
@ -313,7 +313,6 @@ void BufferView::resize()
|
|||||||
LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION << endl;
|
LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION << endl;
|
||||||
|
|
||||||
updateMetrics(false);
|
updateMetrics(false);
|
||||||
switchKeyMap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -627,7 +626,7 @@ boost::tuple<pit_type, pos_type, int> BufferView::moveToPosition(pit_type bottom
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BufferView::switchKeyMap()
|
void BufferView::translateAndInsert(char_type c, Text * t, Cursor & cur)
|
||||||
{
|
{
|
||||||
if (!lyxrc.rtl_support)
|
if (!lyxrc.rtl_support)
|
||||||
return;
|
return;
|
||||||
@ -639,6 +638,8 @@ void BufferView::switchKeyMap()
|
|||||||
if (intl_->keymap == Intl::SECONDARY)
|
if (intl_->keymap == Intl::SECONDARY)
|
||||||
intl_->keyMapPrim();
|
intl_->keyMapPrim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
intl_->getTransManager().translateAndInsert(c, t, cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -779,7 +780,6 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
|
|||||||
cur.message(_("No further undo information"));
|
cur.message(_("No further undo information"));
|
||||||
updateFlags = Update::None;
|
updateFlags = Update::None;
|
||||||
}
|
}
|
||||||
switchKeyMap();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_REDO:
|
case LFUN_REDO:
|
||||||
@ -789,7 +789,6 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
|
|||||||
cur.message(_("No further redo information"));
|
cur.message(_("No further redo information"));
|
||||||
updateFlags = Update::None;
|
updateFlags = Update::None;
|
||||||
}
|
}
|
||||||
switchKeyMap();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_FILE_INSERT:
|
case LFUN_FILE_INSERT:
|
||||||
@ -851,7 +850,6 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
|
|||||||
if (b == buffer_) {
|
if (b == buffer_) {
|
||||||
// Set the cursor
|
// Set the cursor
|
||||||
setCursor(makeDocIterator(par, 0));
|
setCursor(makeDocIterator(par, 0));
|
||||||
switchKeyMap();
|
|
||||||
} else {
|
} else {
|
||||||
// Switch to other buffer view and resend cmd
|
// Switch to other buffer view and resend cmd
|
||||||
theLyXFunc().dispatch(FuncRequest(
|
theLyXFunc().dispatch(FuncRequest(
|
||||||
|
@ -146,8 +146,8 @@ public:
|
|||||||
/// return the pixel height of the document view.
|
/// return the pixel height of the document view.
|
||||||
int workHeight() const;
|
int workHeight() const;
|
||||||
|
|
||||||
/// switch between primary and secondary keymaps for RTL entry.
|
/// translate and insert a character, using the correct keymap.
|
||||||
void switchKeyMap();
|
void translateAndInsert(char_type c, Text * t, Cursor & cur);
|
||||||
|
|
||||||
/// return true for events that will handle.
|
/// return true for events that will handle.
|
||||||
FuncStatus getStatus(FuncRequest const & cmd);
|
FuncStatus getStatus(FuncRequest const & cmd);
|
||||||
|
@ -120,7 +120,6 @@ namespace {
|
|||||||
if (selecting || cur.mark())
|
if (selecting || cur.mark())
|
||||||
cur.setSelection();
|
cur.setSelection();
|
||||||
saveSelection(cur);
|
saveSelection(cur);
|
||||||
cur.bv().switchKeyMap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -679,7 +678,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cutSelection(cur, true, false);
|
cutSelection(cur, true, false);
|
||||||
singleParUpdate = false;
|
singleParUpdate = false;
|
||||||
}
|
}
|
||||||
bv->switchKeyMap();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_DELETE_BACKWARD_SKIP:
|
case LFUN_DELETE_BACKWARD_SKIP:
|
||||||
@ -700,14 +698,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cap::replaceSelection(cur);
|
cap::replaceSelection(cur);
|
||||||
breakParagraph(cur, 0);
|
breakParagraph(cur, 0);
|
||||||
cur.resetAnchor();
|
cur.resetAnchor();
|
||||||
bv->switchKeyMap();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT:
|
case LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT:
|
||||||
cap::replaceSelection(cur);
|
cap::replaceSelection(cur);
|
||||||
breakParagraph(cur, 1);
|
breakParagraph(cur, 1);
|
||||||
cur.resetAnchor();
|
cur.resetAnchor();
|
||||||
bv->switchKeyMap();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_BREAK_PARAGRAPH_SKIP: {
|
case LFUN_BREAK_PARAGRAPH_SKIP: {
|
||||||
@ -719,7 +715,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
else
|
else
|
||||||
breakParagraph(cur, 0);
|
breakParagraph(cur, 0);
|
||||||
cur.resetAnchor();
|
cur.resetAnchor();
|
||||||
bv->switchKeyMap();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -862,7 +857,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
}
|
}
|
||||||
bv->buffer()->errors("Paste");
|
bv->buffer()->errors("Paste");
|
||||||
cur.clearSelection(); // bug 393
|
cur.clearSelection(); // bug 393
|
||||||
bv->switchKeyMap();
|
|
||||||
finishUndo();
|
finishUndo();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -953,7 +947,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
setLayout(cur, layout);
|
setLayout(cur, layout);
|
||||||
// inform the GUI that the layout has changed.
|
// inform the GUI that the layout has changed.
|
||||||
bv->layoutChanged(layout);
|
bv->layoutChanged(layout);
|
||||||
bv->switchKeyMap();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1075,7 +1068,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cap::pasteSelection(cur, bv->buffer()->errorList("Paste"));
|
cap::pasteSelection(cur, bv->buffer()->errorList("Paste"));
|
||||||
bv->buffer()->errors("Paste");
|
bv->buffer()->errors("Paste");
|
||||||
cur.clearSelection(); // bug 393
|
cur.clearSelection(); // bug 393
|
||||||
bv->switchKeyMap();
|
|
||||||
bv->buffer()->markDirty();
|
bv->buffer()->markDirty();
|
||||||
finishUndo();
|
finishUndo();
|
||||||
} else {
|
} else {
|
||||||
@ -1156,7 +1148,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cur.noUpdate();
|
cur.noUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bv->switchKeyMap();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1180,8 +1171,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
docstring::const_iterator cit = cmd.argument().begin();
|
docstring::const_iterator cit = cmd.argument().begin();
|
||||||
docstring::const_iterator end = cmd.argument().end();
|
docstring::const_iterator end = cmd.argument().end();
|
||||||
for (; cit != end; ++cit)
|
for (; cit != end; ++cit)
|
||||||
bv->getIntl().getTransManager().
|
bv->translateAndInsert(*cit, this, cur);
|
||||||
translateAndInsert(*cit, this, cur);
|
|
||||||
|
|
||||||
cur.resetAnchor();
|
cur.resetAnchor();
|
||||||
moveCursor(cur, false);
|
moveCursor(cur, false);
|
||||||
@ -1449,7 +1439,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
Font font(Font::ALL_IGNORE);
|
Font font(Font::ALL_IGNORE);
|
||||||
font.setLanguage(lang);
|
font.setLanguage(lang);
|
||||||
toggleAndShow(cur, this, font);
|
toggleAndShow(cur, this, font);
|
||||||
bv->switchKeyMap();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1524,8 +1513,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
theLyXFunc().handleKeyFunc(cmd.action);
|
theLyXFunc().handleKeyFunc(cmd.action);
|
||||||
if (!cmd.argument().empty())
|
if (!cmd.argument().empty())
|
||||||
// FIXME: Are all these characters encoded in one byte in utf8?
|
// FIXME: Are all these characters encoded in one byte in utf8?
|
||||||
bv->getIntl().getTransManager()
|
bv->translateAndInsert(cmd.argument()[0], this, cur);
|
||||||
.translateAndInsert(cmd.argument()[0], this, cur);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_FLOAT_LIST: {
|
case LFUN_FLOAT_LIST: {
|
||||||
|
@ -1208,7 +1208,6 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cell(i).append(grid.cell(grid.index(r, c)));
|
cell(i).append(grid.cell(grid.index(r, c)));
|
||||||
}
|
}
|
||||||
cur.clearSelection(); // bug 393
|
cur.clearSelection(); // bug 393
|
||||||
cur.bv().switchKeyMap();
|
|
||||||
finishUndo();
|
finishUndo();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -459,7 +459,6 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
}
|
}
|
||||||
cur.niceInsert(topaste);
|
cur.niceInsert(topaste);
|
||||||
cur.clearSelection(); // bug 393
|
cur.clearSelection(); // bug 393
|
||||||
cur.bv().switchKeyMap();
|
|
||||||
finishUndo();
|
finishUndo();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user