Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-02

End-of-Line style for .lpi files keep changing

8 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Lazarus IDE adheres to the existing EOL chars in *.pas files even if they are open on a different platform. Meaning Lazarus IDE doesn't change EOL style for no reason from Linux to Windows if the project was last edited in Linux and then opened under Windows.

Unfortunately the same can not be said for the *.lpi files. This is quite annoying. Could the same rules for *.pas files be applied to *.lpi files?

This issue is easily noticeable when you share the same source code directory between a Linux host and a Windows VM session.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gärtner
to Graeme Geldenhuys

Zitat von Graeme Geldenhuys :

Show quoted text 9 lines
Hi, Lazarus IDE adheres to the existing EOL chars in *.pas files even if they are open on a different platform. Meaning Lazarus IDE doesn't change EOL style for no reason from Linux to Windows if the project was last edited in Linux and then opened under Windows. Unfortunately the same can not be said for the *.lpi files. This is quite annoying. Could the same rules for *.pas files be applied to *.lpi files?

It is completely different code.
laz_xmlread, laz_xmlwrite and project.pp need to be changed.

This issue is easily noticeable when you share the same source code directory between a Linux host and a Windows VM session.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gärtner
Mattias G?rtner wrote 6 lines
> > Unfortunately the same can not be said for the *.lpi files. This is quite > annoying. Could the same rules for *.pas files be applied to *.lpi files? It is completely different code. laz_xmlread, laz_xmlwrite and project.pp need to be changed.

So is this something fixable? Or was the EOL style changing for *.lpi files done by design?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gärtner
to Graeme Geldenhuys

Zitat von Graeme Geldenhuys :

Show quoted text 11 lines
Mattias G?rtner wrote: >> >> Unfortunately the same can not be said for the *.lpi files. This is quite >> annoying. Could the same rules for *.pas files be applied to *.lpi files? > > It is completely different code. > laz_xmlread, laz_xmlwrite and project.pp need to be changed. So is this something fixable? Or was the EOL style changing for *.lpi files done by design?

lpi files are simple xml files. They are written with system lineending. You need to extend the code, that it can write xml files with other line ending, detect the line ending when reading xml, use this in xmlconfig and use this in TProject.
It's not rocket science. Feel free to create a patch.

I guess it makes sense for lpk files too, but it does not make much sense for lps files.

Mattias

Reply by email

Flávio Etrusco
to Mattias Gärtner

2010/2/23 Mattias G?rtner :

Show quoted text 27 lines
Zitat von Graeme Geldenhuys : > Mattias G?rtner wrote: >>> >>> Unfortunately the same can not be said for the *.lpi files. This is >>> quite >>> annoying. Could the same rules for *.pas files be applied to *.lpi >>> files? >> >> It is completely different code. >> laz_xmlread, laz_xmlwrite and project.pp need to be changed. > > > So is this something fixable? ?Or was the EOL style changing for *.lpi > files done by design? lpi files are simple xml files. They are written with system lineending. You need to extend the code, that it can write xml files with other line ending, detect the line ending when reading xml, use this in xmlconfig and use this in TProject. It's not rocket science. Feel free to create a patch. I guess it makes sense for lpk files too, but it does not make much sense for lps files. Mattias

While we're at it, Mattias, do you see a problem in storing (file&folder) paths (in configuration files) always with the same separator instead of changing depending on the platform it's saved?

Best regards,
Fl?vio

Reply by email

Hans-Peter Diettrich
to Graeme Geldenhuys: So is this something fixable? Or was the EOL style changing for *.lpi files done by…
Show quoted text 9 lines
Mattias G?rtner wrote: >> Unfortunately the same can not be said for the *.lpi files. This is quite >> annoying. Could the same rules for *.pas files be applied to *.lpi files? > It is completely different code. > laz_xmlread, laz_xmlwrite and project.pp need to be changed. So is this something fixable? Or was the EOL style changing for *.lpi files done by design?

IMO we then need a project wide LineStyle property, that also is applicable to newly created files. More complications with packages, or editor files in no project or

Reply by email

Mattias Gaertner
to Flávio Etrusco: 2010/2/23 Mattias G?rtner : While we're at it, Mattias, do you see a problem in storing…
Show quoted text 7 lines
2010/2/23 Mattias G?rtner : > Zitat von Graeme Geldenhuys : > [...] While we're at it, Mattias, do you see a problem in storing (file&folder) paths (in configuration files) always with the same separator instead of changing depending on the platform it's saved?

All files and paths of lpi/lpk files use the path delimiter of the OS where the lpi/lpk was created.
That means if you create a project under MS Windows, all paths use '\' as path delimiter. When you open such a project under Linux the path delimiters are changed (in mem, not on disk). But when you change something and save the project the path delimiters are saved as MS Windows path delimiters '\'.

Reasons:
1. This reduces diffs for example "svn diff".
2. It allows to use special characters. For example if the project is only usable under Linux you can use backslashing.

Note:
For example the lpi stores this under ProjectOptions/PathDelim/Value. Default is '/'.

Mattias

Reply by email

Mattias Gaertner
to Hans-Peter Diettrich: IMO we then need a project wide LineStyle property, that also is applicable to newly…
Show quoted text 14 lines
Graeme Geldenhuys schrieb: > Mattias G?rtner wrote: >>> Unfortunately the same can not be said for the *.lpi files. This is quite >>> annoying. Could the same rules for *.pas files be applied to *.lpi files? >> It is completely different code. >> laz_xmlread, laz_xmlwrite and project.pp need to be changed. > > > So is this something fixable? Or was the EOL style changing for *.lpi > files done by design? IMO we then need a project wide LineStyle property, that also is applicable to newly created files. More complications with packages, or editor files in no project or the real problem are tools that can not work with different line

endings. Lazarus can read any line ending since 10 years. FPC probably even longer.

Mattias

Reply by email