commit 92b5cd60b328bc058662b2787d4873310e6dafcc
Author: Juergen Spitzmueller <[email protected]>
Date:   Sat Aug 9 08:17:53 2025 +0200

    Import \noindent within paragraphs as ERT
    
    Otherwise we will eventually drop it with this warning:
    
    tex2lyx warning: Bug: Ignoring par-level extra stuff '\noindent'
    
    Normally, the command does nothing at this position, but we
    should not assume that and silently drop it if it is used in
    such a way in the TeX file (see the example in #13183)
---
 src/tex2lyx/text.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index aa466fe4a6..90954b7742 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -2576,7 +2576,7 @@ void parse_environment(Parser & p, ostream & os, bool 
outer,
                    || name == "doublespace" || name == "spacing") {
                        eat_whitespace(p, os, parent_context, false);
                        // We must begin a new paragraph if not already done
-                       if (! parent_context.atParagraphStart()) {
+                       if (!parent_context.atParagraphStart()) {
                                parent_context.check_end_layout(os);
                                parent_context.new_paragraph(os);
                        }
@@ -3851,7 +3851,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, 
bool outer,
                        continue;
                }
 
-               if (t.cs() == "noindent") {
+               if (t.cs() == "noindent" && context.atParagraphStart()) {
                        p.skip_spaces();
                        context.add_par_extra_stuff("\\noindent\n");
                        continue;
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to