Le 31/07/2017 à 04:27, Richard Heck a écrit :
All the leading tabs are deleted by the validation. This disturbs the
reading of this content. Is there any solution for this?
It works with spaces, but not with tabs. Same problem with the preamble,
actually.
JMarc, this seems to be because Lexer::getLongString trips leading tabs.
Is there an easy way around that?
The way getLongString (added in LyX 0.11.27) was supposed to operate
when I wrote it is
1/ find the prefix (sequence of spaces and tabs[*]) before the first
line; remove this prefix from the line
2/ on the next lines, check whether they start with the same prefix, and
if they do, strip this prefix [**]
The intent was the following: if I have a layout file with the code
Style Aaa
Preamble
% define macro
\def\aaa{foo}
EndPreamble
End
I want the preamble to be
% define macro
\def\aaa{foo}
instead of
% define macro
\def\aaa{foo}
This is what the code tries to do, but there are bugs (see notes below).
One problem beside these bugs is that the method has later been used in
BufferParams to read some other settings. I do not know whether the
space-removing feature is wanted in this case.
Hope the helps.
JMarc
[*] the original code only considered spaces, which is of course wrong
and should be corrected.
[**] a further random change was added to remove all leading tabs
(6bba977f42), which is probably the bug you are seeing.