[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-devel
Subject:    [ jEdit-devel ] [jedit:bugs] #3854 Windows line ending (CR/LF) in version 5.1
From:       "guai" <guai-x () users ! sf ! net>
Date:       2014-12-29 11:59:57
Message-ID: /p/jedit/bugs/3854/41147e5ae470705f4b4d11b5c47bfe2f0c743291.bugs () jedit ! p ! sourceforge ! net
[Download RAW message or body]

[Attachment #2 (multipart/related)]

[Attachment #4 (multipart/alternative)]

[Attachment #6 (text/plain)]

Maybe relative to https://sourceforge.net/p/jedit/bugs/3900/


---

** [bugs:#3854] Windows line ending (CR/LF) in version 5.1**

**Status:** open
**Group:** severe bug
**Created:** Thu Apr 03, 2014 08:36 PM UTC by GHPS 
**Last Updated:** Wed Apr 23, 2014 04:34 PM UTC
**Owner:** nobody

Description: Starting with jEdit 5.1 there is a grave problem with the Windows line \
ending option (CR/LF=/r/n). I came across this problem using the Move Lines Up/Down \
macros from the Macro/Editing menu.  After moving a number of lines several times up \
the file becomes more and more disfigured, reaching either the upper or lower end  \
renders the text completely useless. The problem is not just aesthetics but the saved \
version is crippled as well.

Trying to track down the problem revealed the following clues:
1) The problem is not present in version 5.0.
2)  It is only present with Windows, not with Unix or Mac line ending.
3) Looking at the corrupted file in hex mode the strange behavior can be attributed \
to a bug with the line endings: When a line is moved it is not inserted with "CR/LF" \
but with "CR CR/LF" line ending.  4) Although the macros for moving text have changed \
from 5.0 to 5.1 they are not likely the real cause of this behavior: In line 81 the \
line separator of the system is determined - absolutely correctly as "CR/LF". \
Changing this line to "String lineSeparator = "#"+buffer.getStringProperty( \
"lineSeparator" )+"#";" should result in a line break in form of "#CR/LF#". Actually \
it is "#CR CR/LF" after each freshly inserted block of text. 5) The complete garbage \
at the end/beginning of the file seems to be a result of the superfluous CRs in the \
file. 6) Switching to Unix/Mac line end encoding results in a correct "#LF#"/"#CR#".

Conclusion: Some function executed after the macro falsely corrects the line ending \
in files with Windows CR/LF setting.

Platform: Win XP 32-SP3, Java 1.7.0_45, 



---

Sent from sourceforge.net because jedit-devel@lists.sourceforge.net is subscribed to \
https://sourceforge.net/p/jedit/bugs/

To unsubscribe from further messages, a project admin can change settings at \
https://sourceforge.net/p/jedit/admin/bugs/options.  Or, if this is a mailing list, \
you can unsubscribe from the mailing list.


[Attachment #7 (text/html)]

<div class="markdown_content"><p>Maybe relative to <a \
href="https://sourceforge.net/p/jedit/bugs/3900">https://sourceforge.net/p/jedit/bugs/3900/</a></p>
 <hr />
<p><strong> <a class="alink" \
href="http://sourceforge.net/p/jedit/bugs/3854">[bugs:#3854]</a> Windows line ending \
(CR/LF) in version 5.1</strong></p> <p><strong>Status:</strong> open<br />
<strong>Group:</strong> severe bug<br />
<strong>Created:</strong> Thu Apr 03, 2014 08:36 PM UTC by GHPS <br />
<strong>Last Updated:</strong> Wed Apr 23, 2014 04:34 PM UTC<br />
<strong>Owner:</strong> nobody</p>
<p>Description: Starting with jEdit 5.1 there is a grave problem with the Windows \
line ending option (CR/LF=/r/n). I came across this problem using the Move Lines \
Up/Down macros from the Macro/Editing menu.  After moving a number of lines several \
times up the file becomes more and more disfigured, reaching either the upper or \
lower end  renders the text completely useless. The problem is not just aesthetics \
but the saved version is crippled as well.</p> <p>Trying to track down the problem \
revealed the following clues:<br /> 1) The problem is not present in version 5.0.<br \
/> 2)  It is only present with Windows, not with Unix or Mac line ending.<br />
3) Looking at the corrupted file in hex mode the strange behavior can be attributed \
to a bug with the line endings: When a line is moved it is not inserted with "CR/LF" \
but with "CR CR/LF" line ending. <br /> 4) Although the macros for moving text have \
changed from 5.0 to 5.1 they are not likely the real cause of this behavior: In line \
81 the line separator of the system is determined - absolutely correctly as "CR/LF". \
Changing this line to "String lineSeparator = "#"+buffer.getStringProperty( \
"lineSeparator" )+"#";" should result in a line break in form of "#CR/LF#". Actually \
it is "#CR CR/LF" after each freshly inserted block of text.<br /> 5) The complete \
garbage at the end/beginning of the file seems to be a result of the superfluous CRs \
in the file.<br /> 6) Switching to Unix/Mac line end encoding results in a correct \
"#LF#"/"#CR#".</p> <p>Conclusion: Some function executed after the macro falsely \
corrects the line ending in files with Windows CR/LF setting.</p> <p>Platform: Win XP \
32-SP3, Java 1.7.0_45, </p> <hr />
<p>Sent from sourceforge.net because jedit-devel@lists.sourceforge.net is subscribed \
to <a href="https://sourceforge.net/p/jedit/bugs">https://sourceforge.net/p/jedit/bugs/</a></p>
 <p>To unsubscribe from further messages, a project admin can change settings at <a \
href="https://sourceforge.net/p/jedit/admin/bugs/options.">https://sourceforge.net/p/jedit/admin/bugs/options.</a> \
Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>



------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net

-- 
-----------------------------------------------
jEdit Developers' List
jEdit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic