#652 Only clean non-empty lines.

open
nobody
None
5
2013-03-16
2013-03-16
Kevin Cox
No

Currently there is the option in Geany to clean up whitespace characters at the end of lines. However, many people and projects prefer to leave empty lines with the correct indent. Unfortunately this means that clean spaces can't be used as it removes all of these spaces. It would be nice to be able to prevent the cleaning of empty lines, or if the proper indent could be put there. I think the first option is quite sufficient as the second has a large chance for error.

Discussion

  • Kevin Cox
    Kevin Cox
    2013-03-16

    Version: 1.23
    OS: Arch Linux

     
  • Lex Trotman
    Lex Trotman
    2013-03-16

    We would probably accept a patch/pull request with a sub-option to leave blank lines, which defaulted to the current behaviour.

     
  • Kevin Cox
    Kevin Cox
    2013-03-16

    I have created a patch. It adds a preference to not modify whitespace on otherwise empty lines.

    The way I am doing it now is editor_strip_line_trailing_spaces() checks the preference. I do not know if this is the way you would like it done. The other two options are adding an argument that specifies rather to modify empty lines, or creating a separate function that does the different strip and select which one to call based on the state of the preference.

    I created a setting in the file menu and project menu so that it can be controlled both by default and per project.

     
  • Kevin Cox
    Kevin Cox
    2013-03-30

    Is this the proper place for a patch or should I send it somewhere else?

     
  • Lex Trotman
    Lex Trotman
    2013-03-30

    If you could create a pull request on the Geany github site would be best.

    Just a reminder to update the relevant documentation to describe your additional option.

     
  • Matthew Brush
    Matthew Brush
    2013-03-30

    See note from elextr "Just a reminder to update the relevant documentation to describe your additional option."

    Also, it'd be useful to add it to "Prefs->Various" GUI.

     
  • Kevin Cox
    Kevin Cox
    2013-03-30

    The option is actually directly in the Prefs->File because the code matched with the similar settings and it was required to get in in the per-project setting.

    I will update the docs and add it to the pull request.

     
  • Kevin Cox
    Kevin Cox
    2013-03-30

    Okay, I have updated the pull request with the docs. I didn't regenerate the manual because it seems like you guys just do that every once and a while.