NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PHPed add's caret: ^M


Joined: 27 Nov 2009
Posts: 98
Reply with quote
I use PHPed on Windows. The script files are on Linux. Samba is used to make the script files available to PHPed. It works really well for me.

Until recently. I keep on getting carets (^M) added to the end of some lines. Clutters up git diff with a bunch of not real changes.

Also, every now and then, PHPed pops up a message saying something like the file has been externally modified, do you want to reload it.

Since this only recently started happening, I think I made some change in the PHPed configuration.

Any thoughts? Thanks
View user's profileFind all posts by NotionCommotionSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
PhpED always saves consistent line endings -- either all \r\n or all \n or all \r when windows, unix and mac line endings style selected respectively. So if you have some lines with \r and some without, it's not produced by PhpED, definitely.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 27 Nov 2009
Posts: 98
Reply with quote
Thanks dmitri,

To rule out other culprits, ran git diff to ensure the file had no changes, opened the file with PhpED, added the single line at the bottom, clicked the PhpED save button, and ran git diff again, and you will see I have a bunch of changes.

I then discarded the changes, used Notepad+ which is running on Windows to edit the file which is located on Linux and accessible via the same Samba network which PhpED uses, and it didn't add the ^M characters. If not PhpED, what can be doing this?

Code:
[Michael@devserver dataloggertester]$ git diff
[Michael@devserver dataloggertester]$ git diff
diff --git a/index.html b/index.html
index 18175e0..839df3e 100755
--- a/index.html
+++ b/index.html
@@ -6,7 +6,7 @@
         <style type="text/css">
             #table-container, #form, #cheat-sheet, #table-sources, #response {
                 border: 1px solid black;
-                padding: 5px;
+                padding: 5px;^M
             }
             #table-container {
                 height:500px;
@@ -22,18 +22,18 @@
                 min-height: 0px;
             }

-            #table-container tr td:first-child {
+            #table-container tr td:first-child {^M
                 width: 16px;padding:8px;
             }
-            #table-container tr.c2s td:first-child {
+            #table-container tr.c2s td:first-child {^M
                 background-image: url("resources/left.png");
                 background-repeat: no-repeat;
             }
-            #table-container tr.s2c td:first-child {
+            #table-container tr.s2c td:first-child {^M
                 background-image: url("resources/right.png");
                 background-repeat: no-repeat;
             }
-            #table-container tr.error td:first-child {
+            #table-container tr.error td:first-child {^M
                 background-image: url("resources/error.png");
                 background-repeat: no-repeat;
             }
@@ -74,7 +74,7 @@
             #response {
                 height: 50px;
             }
-        </style>
+        </style>^M
         <script type="text/javascript">
             $(function(){
                 function setPosition() {
@@ -121,7 +121,7 @@
                     else {
                         clearInterval(timer);
                         $('#update').prop('disabled', false);
-                    }
+                    }^M
                 });
                 $('#command').change(function() {
                     switch($(this).val()) {
@@ -226,3 +226,4 @@
             }?></div>
     </body>
 </html>
+Test PhpED
\ No newline at end of file
[Michael@devserver dataloggertester]$
View user's profileFind all posts by NotionCommotionSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Is it a local file? I bet it's not. If you're using a kind of WebDrive or similar tools, they may edit your files too and add all these ^M. For example it's known that WinSCP does that (unless you turn off automatic file type recognition). Regarding PhpED, it's absolutely impossible to get \r on some line endings in this editor. Even if you open a file containing \r at some line endings, then just save it, you'll get either all line endings with \r or no one -- depending on the preferences.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
PHPed add's caret: ^M
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic