From dff9438a3604c689112be71f67f659bc44a0420d Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Thu, 14 Jan 2021 23:25:58 +0100 Subject: [PATCH] FindAdv: Discard the optional arguments of \part, \chapter, ... Not easy selectable anyway, and hard to use while searching. --- src/lyxfind.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 176125c5a9..c816bcc3e8 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -2085,6 +2085,10 @@ void LatexInfo::buildEntries(bool isPatternString) key += interval_.par.substr(params, optend-params); evaluatingOptional = true; optionalEnd = optend; + if (found.keytype == KeyInfo::isSectioning) { + // Remove optional values (but still keep in header) + interval_.addIntervall(params, optend); + } } string token = sub.str(7); int closings; -- 2.39.5