[Geany-devel] Ensure convert line endings before save

Manuel Bua manuel.bua at xxxxx
Tue Jul 6 14:16:55 UTC 2010


  Hello all,
     i already searched for this feature, in case someone else was 
already working on it or if it simply was a bad idea to implement.
For now, i haven't found anything nor something against it so i 
implemented this simple feature, that basically ensure no mixed line 
endings control characters (le-cc) will be saved in the document, patch 
is attached (i used the latest SVN head, 5089).
Let me explain the use case: i'm currently working on a project where 
some of the files contains mixed line endings control characters, ie., 
some lines end with just CR, other with just LF: there is an easy way to 
convert everyone of these control charaters to something else via 
"Document->Set line endings->Convert and set ..." but this isn't 
something i always manage to remember to do and, better, i would like 
the editor to take care of that for me.
So this patch add just that: in the "Preferences->Files->Saving files" 
dialog i added a  checkbox and, if checked, the editor will always 
convert any le-cc to the one currently actively on the document via 
sci_get_eol_mode(doc->editor->sci).
I also would like to propose a change in the way le-cc are presented to 
the user, but i'll do a new post eventually.

Regards,
Manuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ensure_convert_line_endings_before_save.patch
Type: text/x-patch
Size: 7140 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100706/f88a2255/attachment.bin>


More information about the Devel mailing list