You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
UNIX/Mac or Windows text format option for line endings #2822
Developing on windows machine for running on linux machines doesnt work without running through a converter. Could there be an option to switch between the different kind of formats? I'm running a Windows build of Atom v.107 and it defaults to Windows line endings when editing.
This may be too aggressive for some. But if you want to ensure you always have one type of line ending, you can place this in your init script (~/.atom/init.coffee). Just change preferredLineEnding to whatever you'd like.
#borrowed from https://atom.io/packages/line-ending-converter
atom.workspace.observeTextEditors (editor) ->
editor.getBuffer().onWillSave ->
preferredLineEnding = '\r\n'
buffer = editor.getBuffer()
lastRowIndex = buffer.getLastRow()
buffer.transact ->
for rowIndex in [0...lastRowIndex]
do (rowIndex) ->
currEol = buffer.lineEndingForRow rowIndex
if currEol isnt preferredLineEnding
lineEndingRange = new Range(
new Point(rowIndex, buffer.lineLengthForRow(rowIndex)),
new Point(rowIndex + 1, 0)
)
buffer.setTextInRange lineEndingRange, preferredLineEnding,
{ normalizeLineEndings: false }
+1...this is definitely an oversight. At least the case I need this for has a .gitattributes file, but it's already annoying, and I haven't even started the work yet.
I love atom, packages and everything, then i came across this "bug" and decided to still use my old sublime text editor :( ... I don't get how it's possible to publish an editor who can't handle linebreaks it's pretty or less the first thing i would have coded ! I don't want to be rude, i really love the work done so far, that's why i'm so disapointed to have to don't use it :(. Please work on this asap...
Thanks for the feedback everyone! However, all these +1s and 👍s are just adding noise, so to minimize that I'm going to lock this issue for now – this is currently being worked on as part of the Quality Initiative.
Activity
jasonhansel commentedon Jul 11, 2014
👍
screendriver commentedon Oct 28, 2014
+1
stephanfriedrich commentedon Nov 17, 2014
👍
diazemiliano-zz commentedon Nov 20, 2014
👍
Trudko commentedon Dec 12, 2014
👍
hpcsc commentedon Dec 15, 2014
👍
tbuckl commentedon Jan 20, 2015
👍
ipaq3115 commentedon Feb 2, 2015
👍
esterp commentedon Feb 4, 2015
👍
jessebarocio commentedon Feb 9, 2015
👍
sbrech commentedon Feb 11, 2015
konstantin-popov commentedon Feb 13, 2015
👍
mocathe1st commentedon Mar 2, 2015
👍
28 remaining items
supersonicclay commentedon Jun 22, 2015
+1
supersonicclay commentedon Jun 23, 2015
This may be too aggressive for some. But if you want to ensure you always have one type of line ending, you can place this in your init script (
~/.atom/init.coffee). Just changepreferredLineEndingto whatever you'd like.jahio commentedon Jun 24, 2015
Clay, thanks for posting this, that's really useful!
photofroggy commentedon Jun 26, 2015
👍 seems like a massive oversight.
I have git on windows set up to commit and checkout as-is rather than converting line-endings.
famousgarkin commentedon Jul 3, 2015
+1
dead-claudia commentedon Jul 4, 2015
+1...this is definitely an oversight. At least the case I need this for has a .gitattributes file, but it's already annoying, and I haven't even started the work yet.
3ffy commentedon Jul 5, 2015
I love atom, packages and everything, then i came across this "bug" and decided to still use my old sublime text editor :( ... I don't get how it's possible to publish an editor who can't handle linebreaks it's pretty or less the first thing i would have coded ! I don't want to be rude, i really love the work done so far, that's why i'm so disapointed to have to don't use it :(. Please work on this asap...
👍
MattiJarvinen commentedon Jul 7, 2015
This shows a major disregard of Windows users from project managers' side. I really hope they get this sorted out.
While reading comments on this issue, issue voting would remove useless +1 comments.
dead-claudia commentedon Jul 7, 2015
To be honest, this seems perfect for an Atom extension, one that may not last long out of core, but would be vital until then.
jqol commentedon Jul 31, 2015
+1
mnquintana commentedon Jul 31, 2015
Thanks for the feedback everyone! However, all these +1s and 👍s are just adding noise, so to minimize that I'm going to lock this issue for now – this is currently being worked on as part of the Quality Initiative.
maxbrunsfeld commentedon Aug 27, 2015
Atom 1.0.8 will include the line-ending-selector package, which I hope will address this issue. Sorry for the long wait everybody.