mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
make inset-toggle work when cursor is inside inset
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3528 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f7d7339688
commit
d1e32bd66c
@ -1,3 +1,12 @@
|
||||
2002-02-12 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||
|
||||
* lyxfunc.C (getStatus): change the rules for LFUN_INSET_TOGGLE to
|
||||
match the changes below.
|
||||
|
||||
* text2.C (toggleInset): if there is not editable inset at cursor
|
||||
position, try to see if cursor is _inside_ a collapsable inset
|
||||
and close it.
|
||||
|
||||
2002-02-11 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||
|
||||
* lyxfunc.C (getStatus): handle LFUN_SWITCHBUFFER so that the
|
||||
|
@ -476,10 +476,14 @@ FuncStatus LyXFunc::getStatus(kb_action action,
|
||||
break;
|
||||
|
||||
|
||||
case LFUN_INSET_TOGGLE:
|
||||
disable = (TEXT(false)->getInset() == 0);
|
||||
case LFUN_INSET_TOGGLE: {
|
||||
LyXText * lt = owner->view()->getLyXText();
|
||||
disable = !(isEditableInset(lt->getInset())
|
||||
|| (lt->inset_owner
|
||||
&& lt->inset_owner->owner()
|
||||
&& lt->inset_owner->owner()->isOpen()));
|
||||
break;
|
||||
|
||||
}
|
||||
case LFUN_MATH_VALIGN:
|
||||
if (mathcursor) {
|
||||
char align = mathcursor->valign();
|
||||
|
10
src/text2.C
10
src/text2.C
@ -465,8 +465,16 @@ Inset * LyXText::getInset() const
|
||||
void LyXText::toggleInset(BufferView * bview)
|
||||
{
|
||||
Inset * inset = getInset();
|
||||
if (!isEditableInset(inset))
|
||||
// is there an editable inset at cursor position?
|
||||
if (!isEditableInset(inset)) {
|
||||
// No, try to see if we are inside a collapsable inset
|
||||
if (inset_owner && inset_owner->owner()
|
||||
&& inset_owner->owner()->isOpen()) {
|
||||
bview->unlockInset(static_cast<UpdatableInset *>(inset_owner->owner()));
|
||||
inset_owner->owner()->close(bview);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//bview->owner()->message(inset->editMessage());
|
||||
|
||||
// do we want to keep this?? (JMarc)
|
||||
|
Loading…
Reference in New Issue
Block a user