commit 9d333007620d93ac2513682ca9b57165c74e1be4
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Aug 22 06:20:22 2025 +0200
Fix getItemDepth with different counters
If a list with counter foo is nested into a list with counter
bar, it re-starts at first level (fooi)
---
src/Buffer.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index bbb8c591cc..5b79937714 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -5262,11 +5262,12 @@ static depth_type getItemDepth(ParIterator const & it)
}
}
- // We search for the first paragraph with same label
+ // We search for the first paragraph with same counter
// that is not more deeply nested.
Paragraph & prev_par = *prev_it;
depth_type const prev_depth = getDepth(prev_it);
- if (labeltype == prev_par.layout().labeltype) {
+ if (labeltype == prev_par.layout().labeltype
+ && par.layout().counter == prev_par.layout().counter) {
if (prev_depth < min_depth)
return prev_par.itemdepth + 1;
if (prev_depth == min_depth)
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs