mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 22:17:41 +00:00
Consider nesting level when autonesting
This commit is contained in:
parent
05eae049d8
commit
9f13bb73f8
@ -1588,8 +1588,13 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
if (change_layout) {
|
||||
setLayout(cur, layout);
|
||||
if (cur.pit() > 0 && !ignoreautonests) {
|
||||
pit_type prev_pit = cur.pit() - 1;
|
||||
depth_type const cur_depth = pars_[cur.pit()].getDepth();
|
||||
// Scan for the previous par on same nesting level
|
||||
while (prev_pit > 0 && pars_[prev_pit].getDepth() > cur_depth)
|
||||
--prev_pit;
|
||||
set<docstring> const & autonests =
|
||||
pars_[cur.pit() - 1].layout().autonests();
|
||||
pars_[prev_pit].layout().autonests();
|
||||
set<docstring> const & autonested =
|
||||
pars_[cur.pit()].layout().isAutonestedBy();
|
||||
if (autonests.find(layout) != autonests.end()
|
||||
|
Loading…
Reference in New Issue
Block a user