]> git.lyx.org Git - features.git/commitdiff
Work around auto-bibitem insertion when separating bibliography environment
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Jan 2018 14:12:10 +0000 (15:12 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Jan 2018 14:12:10 +0000 (15:12 +0100)
Manually delete bibitem insets in the separator line.

In the long term, such things should not happen at all.

Candidate for 2.3.x.

src/Text3.cpp

index b339e078754efb03b541ec7a02d0e323555ea3b3..b8232e24d29d66d4846ffd5167bda8d8b7427786 100644 (file)
@@ -1644,6 +1644,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                DocumentClass const & tc = bv->buffer().params().documentClass();
                lyx::dispatch(FuncRequest(LFUN_LAYOUT, from_ascii("\"") + tc.plainLayout().name()
                                          + from_ascii("\" ignoreautonests")));
+               // FIXME: Bibitem mess!
+               if (cur.prevInset() && cur.prevInset()->lyxCode() == BIBITEM_CODE)
+                       lyx::dispatch(FuncRequest(LFUN_CHAR_DELETE_BACKWARD));
                lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "plain"));
                if (before) {
                        cur.backwardPos();