stollr commented on issue #4641:
URL: https://github.com/apache/netbeans/issues/4641#issuecomment-1502919047

   ## Steps to reproduce:
   
   * On a linux system, create a new empty file (the file type is irrelevant, 
it is not just for PHP). Let's name it `test.md`.
   * Activate *View -> Show Non-printable Characters*
   * Type `TEST` and Save
   * optional: Add the new file to the Git index with `git add test.md`
   
   
   ## Actual result without Return
   
   Compare the screenshots of Netbeans (left) and the output of `cat -e 
test.md` in a linux terminal:
   
   
![grafik](https://user-images.githubusercontent.com/1118790/231089294-2e47e14d-a6ad-4957-ba97-24f196fa32bd.png)
   
   In the Netbeans editor it shows the ΒΆ at the end of the line. But when you 
print the file at the terminal you see, that there is no trailing LF character 
at the end of the line. 
   
   Running `git diff --cached test.md` will output:
   
   
![grafik](https://user-images.githubusercontent.com/1118790/231096981-ac59cd48-8693-4763-96ac-c694ac08b0f3.png)
   
   This indicates that Git is missing the LF at the end of the file.
   
   
   ## Actual result with Return
   
   Now, press *Return*, save and compare the screenshots again:
   
   
![grafik](https://user-images.githubusercontent.com/1118790/231090832-c5c10f20-945d-45c1-9772-d32e0dbbe8ac.png)
   
   Netbeans shows two lines now, although other linux tools interprete this as 
one line.
   
   If you run `git add test.md` and `git diff --cached test.md` again, Git will 
also show only one line **without the "No newline at end of file" notice**.
   
   
   ## Expected result
   
   For files with Unix (LF) line terminators, I expect that **every** line is 
terminated with a LF character:
   
   
![grafik](https://user-images.githubusercontent.com/1118790/231102645-095d7f64-3e8f-44de-b2b5-5adabdbfcdea.png)
   
   I hope this helps to understand the issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to