]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Update toolbar and properly reset focus when find widget is closed (#12396)
[lyx.git] / src / Paragraph.cpp
index 709507b084265280e9ea7214661603de0866b61a..6b1e118697cabbd6a2b099f8a5d11a4ac894fdfa 100644 (file)
@@ -2351,13 +2351,27 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams,
 
        LyXAlignment const curAlign = params_.align();
 
-       // Do not output \\noindent for paragraphs that are not part of the
-       // immediate text sequence (e.g., contain only floats), that cannot
-       // have indentation, that are PassThru or centered.
-       if (canindent && params_.noindent() && owner_->isPartOfTextSequence()
-           && !layout_->pass_thru && curAlign != LYX_ALIGN_CENTER) {
-               os << "\\noindent ";
-               column += 10;
+       // Do not output \\noindent for paragraphs
+       // 1. that cannot have indentation or are indented always,
+       // 2. that are not part of the immediate text sequence (e.g., contain only floats),
+       // 3. that are PassThru,
+       // 4. or that are centered.
+       if (canindent && params_.noindent()
+           && owner_->isPartOfTextSequence()
+           && !layout_->pass_thru
+           && curAlign != LYX_ALIGN_CENTER) {
+               if (!owner_->empty()
+                   && (owner_->isInset(0)
+                       && owner_->getInset(0)->lyxCode() == VSPACE_CODE))
+                       // If the paragraph starts with a vspace, the \\noindent
+                       // needs to come after that (as it leaves vmode).
+                       // If the paragraph consists only of the vspace,
+                       // \\noindent is not needed at all.
+                       runparams.need_noindent = owner_->size() > 1;
+               else {
+                       os << "\\noindent" << termcmd;
+                       column += 10;
+               }
        }
 
        if (curAlign == layout_->align)