-
Notifications
You must be signed in to change notification settings - Fork 18
add setting for default new file line endings #7
Conversation
So.. Is this going in? (People want/need this.. ;)) |
type: 'string', | ||
'default': 'OS Default', | ||
enum: ['OS Default', 'LF', 'CRLF'], | ||
descrition: 'Default line ending for new documents' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: descrition
-> description
.
@clintwood Thanks for adding this! Could you (or anybody who is interested) add a test for this functionality? You could expand this test to cover the cases where |
@@ -10,6 +10,16 @@ const LineEndingRegExp = /\r\n|\n/g | |||
|
|||
let disposables = null | |||
|
|||
export let config = { | |||
defaultNewFileLineEnding: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think defaultNewFileLineEnding
is a bit verbose as a name. How do you feel about changing it to defaultLineEnding
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, was to be explicit about the fact that it was just applied for new files.
Will update PR.
Regarding the tests, I'm up against hard deadline ATM, and can only update tests realistically early January. Happy to accept patches which I can check and push! |
Ok, I had a quick hack on the tests, please let me know if that covers the changes for this PR. |
66ec422
to
1c6e4f7
Compare
@clintwood These tests look very nice. Great work! |
add setting for default new file line endings
Cool! |
This will be in the next Atom release. |
Did this ever make into Atom? Would be quite useful. |
@Patman64, I can confirm it is in the version I'm running 1.5.3, but I would assume it landed quite a while before this version! |
OK, just found the option. For anyone who finds this in the future, you have to go to File -> Settings -> Packages -> line-ending-selector -> Settings -> Default line ending for new files. Thanks @clintwood. |
This PR resolves #5 by enabling setting the default line endings for new files as shown below.
'\n'
for new files'\r\n'
for new filesThis is purely for new files and does not affect changes made after the new file has been created and contains text.