do not eat the selection when inserting an index entry

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10635 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2005-11-30 15:51:12 +00:00
parent 2688ee7626
commit 4f8b86badf
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2005-11-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* text3.C (dispatch/LFUN_INDEX_INSERT): when a selection is set,
do not remove it (this inset behaves differently from the others).
2005-11-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org> 2005-11-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
Fix bug 2096. Fix bug 2096.

View File

@ -1220,11 +1220,18 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
cur.dispatch(FuncRequest(LFUN_LAYOUT, "Caption")); cur.dispatch(FuncRequest(LFUN_LAYOUT, "Caption"));
break; break;
case LFUN_INDEX_INSERT: case LFUN_INDEX_INSERT: {
// Just open the inset InsetBase * inset = createInset(&cur.bv(), cmd);
doInsertInset(cur, this, cmd, true, false); if (!inset)
break;
recordUndo(cur);
cur.clearSelection();
insertInset(cur, inset);
inset->edit(cur, true);
cur.posRight(); cur.posRight();
break; break;
}
case LFUN_INDEX_PRINT: case LFUN_INDEX_PRINT:
case LFUN_TOC_INSERT: case LFUN_TOC_INSERT: