Skip to content

Commit

Permalink
Turn on adding a final new line on macOS and Linux (fixes #141169)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Feb 27, 2023
1 parent d772411 commit 9a91006
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vs/editor/common/config/editorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5333,7 +5333,7 @@ export const EditorOptions = {
)),
renderFinalNewline: register(new EditorStringEnumOption(
EditorOption.renderFinalNewline, 'renderFinalNewline',
(platform.isLinux ? 'dimmed' : 'on') as 'off' | 'on' | 'dimmed',
(platform.isLinux || platform.isMacintosh ? 'dimmed' : 'on') as 'off' | 'on' | 'dimmed',
['off', 'on', 'dimmed'] as const,
{ description: nls.localize('renderFinalNewline', "Render last line number when the file ends with a newline.") }
)),
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/files/browser/files.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { FileEditorInput } from 'vs/workbench/contrib/files/browser/editors/file
import { BinaryFileEditor } from 'vs/workbench/contrib/files/browser/editors/binaryFileEditor';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { isNative, isWeb, isWindows } from 'vs/base/common/platform';
import { isLinux, isMacintosh, isNative, isWeb, isWindows } from 'vs/base/common/platform';
import { ExplorerViewletViewsContribution } from 'vs/workbench/contrib/files/browser/explorerViewlet';
import { IEditorPaneRegistry, EditorPaneDescriptor } from 'vs/workbench/browser/editor';
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
Expand Down Expand Up @@ -217,7 +217,7 @@ configurationRegistry.registerConfiguration({
},
'files.insertFinalNewline': {
'type': 'boolean',
'default': false,
'default': (isLinux || isMacintosh ? true : false),
'description': nls.localize('insertFinalNewline', "When enabled, insert a final new line at the end of the file when saving it."),
'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE
},
Expand Down

0 comments on commit 9a91006

Please sign in to comment.