[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [StrongED] Feature suggestion/request
The following bytes were arranged on 31 Oct 2010 by Fred Graute :
> In message <516ecf949fLists@xxxxxxxxxxxxxx>
> "Richard Torrens (lists)" <Lists@xxxxxxxxxxxxxx> wrote:
>
> > I have an RSS feed that doesn't display well in Pluto or StrongEd.
> >
> > It would however display nicely if both 0D and 0A were treated as \n, in
> > any combination.
>
> Getting StrongED to treat any combination of 0A and 0D as a newline
> would be a mayor undertaking as everything that deals with newlines
> would need to be altered to get this to work satisfactorily. This
> includes hard- and soft-wrapping, syntaxcolouring, search (and replace).
A better solution which would probably require less effort would be to
change the functionality of the 'Change NL type' menu so it ignores the
currently assumed type and replaces *all* permutations of 0A0D, 0D0A,
0D and 0A with the new one.
Probably the best way to implement this would be to scan through the
document multiple times with 0A0D coming first and being replaced with
0A, then replacing 0D0A with 0A, then 0D, and finally replacing all 0As
with the new type. When dealing with 0A0D, care would need to be taken
to ensure that a match was not preceded by an 0D so that sequences like
0D0A0D0A0D0A would be ignored in that pass.
If I'm right, which is unlikely, the pattern would look something like
this:
Replace("(~\x0D)\x0A\x0D","\l",text,noline,nocase)
Replace("\x0D\x0A","\l",text,noline,nocase)
Replace("\x0D","\l",text,noline,nocase)
Replace("\x0A","*",text,noline,nocase)
Where * in the last string is replaced by the new type (or omitted if
changing to 0A).
I bet it doesn't work, though - IME the ~ modifier is hideously
unreliable. (In fact, I'd been meaning to post on that subject, but
kept forgetting.)
--
__<^>__
/ _ _ \ I don't have a problem with God; it's his fan club I can't stand.
( ( |_| ) )
\_> <_/ ======================= Martin Bazley ==========================
--
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx