As the title said. I looked at the brackets API and all it mentions is that things are normalized to use "the current line endings". I don't ever want brackets to think that \r\n is the current line ending, and _always_ use \n. How do I accomplish that?
@Deathspike There's not yet an API for that, but you can manually edit the getPlatformLineEndings() function.
We should add an API call for this. Marking this as a Starter Bug.
An additional note: Brackets on a Windows-machine does not correctly detect Unix-style line feeds and will always change to \r\n upon saving a document.
@Deathspike It absolutely should detect it -- please file a new bug with details if you're not seeing that. If you can share specific files that show the problem, please post them in the bug.
There was some discussion of this on IRC earlier today. Just so it's captured, my suggestions were:
defaultLineEndings pref, which basically changes the value of FileUtils.getPlatformLineEndings() -- so it would affect both new Untitled documents as well as any existing documents where the existing line endings can't be detected (e.g. opening a 1-line file). We need to be wary about the risk of an added FileUtils->PreferencesManager dependency creating a new circular dependency chain, however.+1
+1
I wrote a plugin last night to help switch the newline character for an individual file.
https://github.com/LonelyStorm/brackets-newline
It will help until offical support is added.
@JBodkin: Much appreciated!
+1
@JBodkin works nicely for now. Many thanks!
@JBodkin thx for the plugin
really need this as a setting to change the default behaviour. even a hack would help
+1
+1 for a configuration option to force newlines as LF (or CRLF) as opposed to the platform default.
working on it in https://github.com/adobe/brackets/pull/13152
+1 Definitely looking forward to this - have run into quite a few issues with Docker that were all caused by line endings from Linux -> Windows.
What is the status on this?
Most helpful comment
What is the status on this?