Updated toggle fold so it works if cursor isn't in head line (feature request 1824940).
This commit is contained in:
parent
55759f3a6d
commit
204d42124a
|
@ -1728,8 +1728,25 @@ void XmlCtrl::toggleFold()
|
|||
return;
|
||||
line = LineFromPosition ( pos );
|
||||
level = GetFoldLevel ( line );
|
||||
|
||||
for ( int iterator = line; iterator > 0; iterator--)
|
||||
{
|
||||
if (iterator != line)
|
||||
{
|
||||
GotoLine ( iterator );
|
||||
level = GetFoldLevel ( iterator );
|
||||
}
|
||||
|
||||
if ( XMLCTRL_HASBIT ( level, wxSTC_FOLDLEVELHEADERFLAG ) )
|
||||
ToggleFold ( line );
|
||||
{
|
||||
ToggleFold ( iterator );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// was previously (changed so cursor doesn't have to be in headline):
|
||||
// if ( XMLCTRL_HASBIT ( level, wxSTC_FOLDLEVELHEADERFLAG ) )
|
||||
// ToggleFold ( line );
|
||||
}
|
||||
|
||||
// adapted from wxSTEdit (c) 2005 John Labenski, Otto Wyss
|
||||
|
|
Loading…
Reference in New Issue