#197 Trim trailing spaces on file save

closed-works-for-me
core (195)
5
2008-01-23
2008-01-23
John Mikich
No

Greetings,

This is one of the best features of UltraEdit-32, my files are always clean automatically on save, I don't have to go to Edit->Indent->Remove Trailing Whitespace every time I am saving a file.

Thank you for your attention,

John Mikich

Discussion

  • Matthieu Casanova

    • status: open --> pending
     
  • Matthieu Casanova

    Logged In: YES
    user_id=285591
    Originator: NO

    Hi, this is very easy to do :
    you can create a macro that contains that

    textArea.removeTrailingWhiteSpace();
    buffer.save(view,null,true);

    and bind it to ctrl+S (or the binding you like)

    Is it necessary to add that to jEdit itself ?

     
  • John Mikich

    John Mikich - 2008-01-23
    • status: pending --> open
     
  • John Mikich

    John Mikich - 2008-01-23

    Logged In: YES
    user_id=1430604
    Originator: YES

    It's good to have ability to write different macros, however, macros are a nuisance to maintain when upgrading and migrating to different machines etc.

    I think it's essential that this feature is added to jEdit itself, therefore it will always be available without extra tinkering. Of course, it should be presented as an option for the user to enable it or not. After all, that's why Edit->Indent->Remove Trailing
    Whitespace feature is incorporated directly into jEdit. Otherwise, it could've been done by macro as well.

    Actually, I just found out that Edit->Indent->Remove Trailing Whitespace as well as your macro only remove trailing spaces at the end of the file, not in every line of the file!

     
  • Matthieu Casanova

    • assigned_to: nobody --> kpouer
     
  • Matthieu Casanova

    Logged In: YES
    user_id=285591
    Originator: NO

    You're right, I was too fast, I'll add that

     
  • Alan Ezust

    Alan Ezust - 2008-01-23

    Logged In: YES
    user_id=935841
    Originator: NO

    The Whitespace plugin also has this feature.

    plugin options - whitespace - on save actions - lots of options there.

     
  • Alan Ezust

    Alan Ezust - 2008-01-23
    • status: open --> closed-works-for-me
     
  • Alan Ezust

    Alan Ezust - 2008-01-23

    Logged In: YES
    user_id=935841
    Originator: NO

    The Whitespace plugin also has this feature.

    plugin options - whitespace - on save actions - lots of options there.

     

Log in to post a comment.