Form Designer changes EOL characters to CRLF under Linux
Original Reporter info from Mantis: ggeldenhuys
-
Reporter name: Graeme Geldenhuys
Original Reporter info from Mantis: ggeldenhuys
- Reporter name: Graeme Geldenhuys
Description:
After the lovely debate on the mailing list, things ending up being a Git vs SubVersion debate, which was not the point. So at home (on a different computer than my work PC), I only used SVN to show the bug in the Form Designer.
See the attached files and images.
I checked out the files using command line client svn.
graemeg@pluto:/tmp/filebrowser$ svn co http://svn.freepascal.org/svn/lazarus/trunk/components/filebrowser filebrowser
I then double checked that the files have their eol-style setup for SubVersion. The following output proved that.
============================== graemeg@pluto:/tmp/filebrowser$ svn pl frmconfigfilebrowser.* Properties on 'frmconfigfilebrowser.lfm': svn:mime-type svn:eol-style Properties on 'frmconfigfilebrowser.lrs': svn:mime-type svn:eol-style Properties on 'frmconfigfilebrowser.pp': svn:mime-type svn:eol-style ==============================
I then made a copy of the above three file and placed them in a directory called '/tmp/filebrowser/origin/' for later comparison.
I then loaded the form in Lazarus Form Designer. Changed a property and clicked save. I then changed the property back to what it was and clicked save again.
Now I started doing comparisons to show the the EOL characters of the whole .lfm and .lrs files have changed from LF (I am using linux here) to CRLF (which is the windows format).
svn diff had the following output which you would assume means that the EOL characters have not changed.... but that is actually wrong. The changes show here is simply because the last Lazarus used to edit that file was 0.9.25 and I am now using 0.9.27. So we ignore those changes and concentrate on the EOL characters only.
===============================
graemeg@pluto:/tmp/filebrowser$ svn diff
Index: frmconfigfilebrowser.lfm
===================================================================
--- frmconfigfilebrowser.lfm (revision 20583)
+++ frmconfigfilebrowser.lfm (working copy)
@@ -3,18 +3,17 @@
Height = 200
Top = 184
Width = 400
+ ActiveControl = RBUseProjectDir
Caption = 'Configure file browser'
ClientHeight = 200
ClientWidth = 400
OnShow = FormShow
- LCLVersion = '0.9.25'
+ LCLVersion = '0.9.27'
[.....snip.....]
===============================
Not being convinced, I used the 'syn' editor available from SourceForge.net which when loading a file shows you the eol style being used in the status line. See attached files. Opening the .lfm file in the current directory and the backup copy in the 'origin' directory, syn showed that the one in the current directory now has the DOS (CRLF) eol style. The backup .lfm in the origin directory shows it has the UNIX (LF) eol style.
To prove the point further I used a more advanced tool (note, I am not using git anywhere here). So I opted to use the well known Beyond Compare v2 tool. I set bc2 to use Rule Based comparison. On first comparison, it showed the same output as 'svn diff' did. So I looked at the comparison rules and made some changes (as shown in the attached screenshots) which doesn't treat end-of-line or other whitespace characters as unimportant. I also enabled the "show whitespace" in the file viewer. See attached screenshot. Suddenly every single line is shown as changed.
So clearly using the Linux version of Lazarus (gtk2 widget set) and modifying a form in the Form Designer, it changes the eol style to CRLF when in fact I am working on a Linux system which uses LF eol characters. It seems standard code units like *.pp and *.pas files are not affected by the Lazarus editor.
I hope this proves the point that there is a bug in the Form Designer.
Mantis conversion info:
- Mantis ID: 13963
- OS: Ubuntu Linux
- OS Build: 7.10
- Build: latest svn
- Platform: x86
- Version: 0.9.27 (SVN)
- Fixed in revision: 20585 (#bbb1de78)
- Target version: 0.9.28