[Geany] [PATCH] Strip trailing spaces when editing

John Gabriele jmg3000 at xxxxx
Wed Sep 26 18:00:49 UTC 2007


On 9/26/07, Nick Treleaven <nick.treleaven at btinternet.com> wrote:
> On 26/09/07 17:22:12, Enrico Tröger wrote:
> > On Wed, 26 Sep 2007 15:49:25 +0100, "Catalin Marinas"
> > <catalin.marinas at gmail.com> wrote:
> > > My solution (this is actually the behaviour of emacs) is to strip
> > the
> > > trailing spaces of a single line when newline is inserted.
>
> This would be great.
>
> > The
> > problem is, sometimes you edit files but don't insert a newline, so
> > the
> > trailing spaces still exist. If you think of this and add and remove
> > the newline to manually invoke the function, all is fine. But I guess
> > there are some people like me, who probably won't think of it ;-).
>
> As suggested before, we could also add a 'Strip trailing spaces'
> command in the Document menu.

If I'm understanding Catalin's problem correctly, it sounds like he
wants a way to make sure only the part of the code he's changing has
the trailing spaces stripped. Seems like it might be simplest to have
an item under the Edit menu for "strip trailing spaces in selection"
(that is, affect the text that's currently selected).

I don't think this would belong under the Document menu, since it
wouldn't affect the entire document as a whole.

Also, if you wanted to strip trailing spaces for the whole doc, and
don't have "Prefs --> Files tab --> strip trailing spaces" selected,
you could always select-all, then strip-trailing-spaces-in-selection.

---John


More information about the Users mailing list