开发者

Mess in php file when edited on different computers?

I work home with Dreamweaver cs5 on windows 7 and on work on windows xp Dreamweaver cs5.5 When i edit file home and open it from ftp on my work all spaces between lines of code double when i get home and open file there are additional space line added to each emp开发者_高级运维ty line why is this happening?

e.g.

if (true) {

 test();

};

now looks like

if (true) {





 test();





};

and this is everywhere. Also sometimes rarely i open file and my php code does not have no new lines its all on the same big line like this.

if (true) {     test();  };

Someone knows whats the problem here?


Maybe it will be not best answer, but...
Dreamweaver is wrong tool, use normal IDEs - PhpStorm or NetBeans.


  1. Open the file
  2. Click CTRL + F
  3. Select "Current document" in "Find in" (You can also select the folder if you have multiple files)
  4. Search in "Source code"
  5. Tick "Use regular expression"
  6. Type "[\r\n]{2,}" (without quotes) in "Find"
  7. Type "\n" (without quotes) in "Replace"
  8. Press "Replace All"


This is something that does come up with Dreamweaver and it happens when you're on a Windows machine and you download a file from a Unix server.

There's a fairly easy fix to immediately get rid of the extra line breaks at least, if that's the current issue, and to prevent them in the future:

http://www.jaredstenquist.com/2009/02/13/removing-extra-linebreaks-and-spaces-in-dreamweaver/

When removing extra line breaks, it will remove all empty breaks so be sure this is what you want - you may have to create some manual breakss over again.

As for line breaks not appearing in rare cases, I suspect setting line break type to match your sever's as suggested in that article may address that issue as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜