- Subject: Re: Preserving trailing whitespace?
- From: Lloyd Zusman <ljz@xxxxxxxxxx>
- Date: Fri, 19 Nov 2004 21:36:52 -0500
I found out why this happens. I found this in src/cmds.c ...
/*{{{ eol_cmd */
int eol_cmd (void)
{
eol();
if ((0 == (CBuf->flags & READ_ONLY))
#if JED_HAS_LINE_ATTRIBUTES
&& (0 == (CLine->flags & JED_LINE_IS_READONLY))
#endif
)
jed_trim_whitespace();
return(1);
}
Is there any way to change this so that the call of
jed_trim_whitespace() can be conditionally disabled in eol_cmd?
At Fri, 19 Nov 2004 21:30:13 -0500,
Lloyd Zusman wrote:
>
> CORRECTION: I made a mistake, and Highlight_Trailing_Whitespace indeed
> works. So you can ignore everything that I wrote about that, below.
>
> However, I still am having the problem with trailing whitespace
> disappearing per steps 1-8 below.
>
> With Highlight_Trailing_Whitespace set, I can see the white space
> disappear at step 5. In fact, it goes away even if I leave out step 6.
>
> I want to have the option of preserving trailing white space, and if I
> choose to do so, I'd always like the cursor to be positioned _beyond_
> this trailing space if I position to the end of the line.
>
> Is this possible in jed?
>
> Thanks.
>
> P.S. -- The reason I want this is because sometimes, trailing whitespace
> is significant. For example, when using Markdown, the way to
> specify that lines not be wrapped is to put at least two spaces
> at the ends of these lines.
>
>
> At Fri, 19 Nov 2004 21:22:11 -0500,
> Lloyd Zusman wrote:
> >
> > I'm using version B0.99.17, and I'm noticing that trailing white space
> > sometimes disappears. What I mean is this:
> >
> > 1. Open a file with jed.
> > 2. Go to an arbitrary line.
> > 3. Append some white space to the end.
> > 4. Go somewhere else in the file and make other changes.
> > 5. Position back to the original line and go to the end. The cursor
> > will be positioned after the final character as if no white space
> > exists.
> > 6. Cursor down a few lines.
> > 7. Save and exit.
> > 8. View the file in some other editor. The line where the trailing
> > white space was added no longer contains any trailing white space.
> >
> > However, if I only do steps 1, 2, 3, 7, and 8, the trailing white space
> > remains.
> >
> > I have put "Highlight_Trailing_Whitespace = 1;" in my initialization file,
> > and I have the following in my color setup file:
> >
> > set_color("trailing_whitespace", "white", "blue");
> >
> > However, I don't see the trailing white space in any case.
> >
> > But even if I could see this white space, it seems to disappear at
> > random times after I save the file.
> >
> > So, there are two separate but related issues here:
> >
> > 1. White space at the end of lines sometimes goes away when I
> > save the file.
> >
> > 2. Highlight_Trailing_Whitespace doesn't seem to work.
> >
> > Is any of this familiar to anyone?
> >
> > Thanks in advance.
> >
> > --
> > Lloyd Zusman
> > ljz@xxxxxxxxxx
> > God bless you.
> >
> > --------------------------
> > To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
> > the word "unsubscribe" in the message body.
> > Need help? Email <jed-users-owner@xxxxxxxxxxx>.
>
> --
> Lloyd Zusman
> ljz@xxxxxxxxxx
> God bless you.
>
> --------------------------
> To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
> the word "unsubscribe" in the message body.
> Need help? Email <jed-users-owner@xxxxxxxxxxx>.
--
Lloyd Zusman
ljz@xxxxxxxxxx
God bless you.
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2004 date index]
[2004 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]