]> git.lyx.org Git - lyx.git/commitdiff
FindAdv: Discard the optional arguments of \part, \chapter, ...
authorKornel Benko <kornel@lyx.org>
Thu, 14 Jan 2021 22:25:58 +0000 (23:25 +0100)
committerKornel Benko <kornel@lyx.org>
Thu, 14 Jan 2021 22:25:58 +0000 (23:25 +0100)
Not easy selectable anyway, and hard to use while searching.

src/lyxfind.cpp

index 176125c5a9dcd4e564185ee93542cf9eef3173cb..c816bcc3e867ce851932004d8498854e0cfcfa54 100644 (file)
@@ -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;