]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.cpp
Update status
[lyx.git] / src / CutAndPaste.cpp
index 9507b2b57f1fb70b7160da88b25ad212b3366d6d..cad8c943deeb8cf5550092e49c20198bd133eeb7 100644 (file)
@@ -1090,7 +1090,12 @@ void copySelection(Cursor const & cur, docstring const & plaintext)
                Paragraph par;
                BufferParams const & bp = cur.buffer()->params();
                par.setLayout(bp.documentClass().plainLayout());
-               par.insert(0, plaintext, Font(), Change(Change::UNCHANGED));
+               // Replace (column-separating) tabs by space (#4449)
+               docstring const clean_text = subst(plaintext, '\t', ' ');
+               // For pasting into text, we set the language to the paragraph language
+               // (rather than the default_language which is always English; see #11898)
+               par.insert(0, clean_text, Font(sane_font, par.getParLanguage(bp)),
+                          Change(Change::UNCHANGED));
                pars.push_back(par);
                theCuts.push(make_pair(pars, bp.documentClassPtr()));
        } else {