提交 cfcd1568 编写于 作者: R Rekicho 提交者: Alex Dima

Added displayBlankLastLineNumber setting

上级 bbe40c8c
...@@ -264,6 +264,11 @@ const editorConfiguration: IConfigurationNode = { ...@@ -264,6 +264,11 @@ const editorConfiguration: IConfigurationNode = {
'default': 'on', 'default': 'on',
'description': nls.localize('lineNumbers', "Controls the display of line numbers.") 'description': nls.localize('lineNumbers', "Controls the display of line numbers.")
}, },
'editor.displayBlankLastLineNumber': {
'type': 'boolean',
'default': true,
'description': nls.localize('displayBlankLastLineNumber', "Controls whether last file line number is displayed when that line is blank.")
},
'editor.rulers': { 'editor.rulers': {
'type': 'array', 'type': 'array',
'items': { 'items': {
......
...@@ -248,6 +248,11 @@ export interface IEditorOptions { ...@@ -248,6 +248,11 @@ export interface IEditorOptions {
* Defaults to true. * Defaults to true.
*/ */
lineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); lineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
/*
* Controls whether last file line number is displayed when that line is blank.
* Defaults to true.
*/
displayBlankLastLineNumber?: boolean;
/** /**
* Should the corresponding line be selected when clicking on the line number? * Should the corresponding line be selected when clicking on the line number?
* Defaults to true. * Defaults to true.
...@@ -951,6 +956,7 @@ export interface InternalEditorViewOptions { ...@@ -951,6 +956,7 @@ export interface InternalEditorViewOptions {
readonly ariaLabel: string; readonly ariaLabel: string;
readonly renderLineNumbers: RenderLineNumbersType; readonly renderLineNumbers: RenderLineNumbersType;
readonly renderCustomLineNumbers: ((lineNumber: number) => string) | null; readonly renderCustomLineNumbers: ((lineNumber: number) => string) | null;
readonly displayBlankLastLineNumber: boolean;
readonly selectOnLineNumbers: boolean; readonly selectOnLineNumbers: boolean;
readonly glyphMargin: boolean; readonly glyphMargin: boolean;
readonly revealHorizontalRightPadding: number; readonly revealHorizontalRightPadding: number;
...@@ -1258,6 +1264,7 @@ export class InternalEditorOptions { ...@@ -1258,6 +1264,7 @@ export class InternalEditorOptions {
&& a.ariaLabel === b.ariaLabel && a.ariaLabel === b.ariaLabel
&& a.renderLineNumbers === b.renderLineNumbers && a.renderLineNumbers === b.renderLineNumbers
&& a.renderCustomLineNumbers === b.renderCustomLineNumbers && a.renderCustomLineNumbers === b.renderCustomLineNumbers
&& a.displayBlankLastLineNumber === b.displayBlankLastLineNumber
&& a.selectOnLineNumbers === b.selectOnLineNumbers && a.selectOnLineNumbers === b.selectOnLineNumbers
&& a.glyphMargin === b.glyphMargin && a.glyphMargin === b.glyphMargin
&& a.revealHorizontalRightPadding === b.revealHorizontalRightPadding && a.revealHorizontalRightPadding === b.revealHorizontalRightPadding
...@@ -1995,6 +2002,7 @@ export class EditorOptionsValidator { ...@@ -1995,6 +2002,7 @@ export class EditorOptionsValidator {
ariaLabel: _string(opts.ariaLabel, defaults.ariaLabel), ariaLabel: _string(opts.ariaLabel, defaults.ariaLabel),
renderLineNumbers: renderLineNumbers, renderLineNumbers: renderLineNumbers,
renderCustomLineNumbers: renderCustomLineNumbers, renderCustomLineNumbers: renderCustomLineNumbers,
displayBlankLastLineNumber: _boolean(opts.displayBlankLastLineNumber, defaults.displayBlankLastLineNumber),
selectOnLineNumbers: _boolean(opts.selectOnLineNumbers, defaults.selectOnLineNumbers), selectOnLineNumbers: _boolean(opts.selectOnLineNumbers, defaults.selectOnLineNumbers),
glyphMargin: _boolean(opts.glyphMargin, defaults.glyphMargin), glyphMargin: _boolean(opts.glyphMargin, defaults.glyphMargin),
revealHorizontalRightPadding: _clampedInt(opts.revealHorizontalRightPadding, defaults.revealHorizontalRightPadding, 0, 1000), revealHorizontalRightPadding: _clampedInt(opts.revealHorizontalRightPadding, defaults.revealHorizontalRightPadding, 0, 1000),
...@@ -2115,6 +2123,7 @@ export class InternalEditorOptionsFactory { ...@@ -2115,6 +2123,7 @@ export class InternalEditorOptionsFactory {
ariaLabel: (accessibilityIsOff ? nls.localize('accessibilityOffAriaLabel', "The editor is not accessible at this time. Press Alt+F1 for options.") : opts.viewInfo.ariaLabel), ariaLabel: (accessibilityIsOff ? nls.localize('accessibilityOffAriaLabel', "The editor is not accessible at this time. Press Alt+F1 for options.") : opts.viewInfo.ariaLabel),
renderLineNumbers: opts.viewInfo.renderLineNumbers, renderLineNumbers: opts.viewInfo.renderLineNumbers,
renderCustomLineNumbers: opts.viewInfo.renderCustomLineNumbers, renderCustomLineNumbers: opts.viewInfo.renderCustomLineNumbers,
displayBlankLastLineNumber: opts.viewInfo.displayBlankLastLineNumber,
selectOnLineNumbers: opts.viewInfo.selectOnLineNumbers, selectOnLineNumbers: opts.viewInfo.selectOnLineNumbers,
glyphMargin: opts.viewInfo.glyphMargin, glyphMargin: opts.viewInfo.glyphMargin,
revealHorizontalRightPadding: opts.viewInfo.revealHorizontalRightPadding, revealHorizontalRightPadding: opts.viewInfo.revealHorizontalRightPadding,
...@@ -2577,6 +2586,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { ...@@ -2577,6 +2586,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"), ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"),
renderLineNumbers: RenderLineNumbersType.On, renderLineNumbers: RenderLineNumbersType.On,
renderCustomLineNumbers: null, renderCustomLineNumbers: null,
displayBlankLastLineNumber: true,
selectOnLineNumbers: true, selectOnLineNumbers: true,
glyphMargin: true, glyphMargin: true,
revealHorizontalRightPadding: 30, revealHorizontalRightPadding: 30,
......
...@@ -2582,6 +2582,7 @@ declare namespace monaco.editor { ...@@ -2582,6 +2582,7 @@ declare namespace monaco.editor {
* Defaults to true. * Defaults to true.
*/ */
lineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); lineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
displayBlankLastLineNumber?: boolean;
/** /**
* Should the corresponding line be selected when clicking on the line number? * Should the corresponding line be selected when clicking on the line number?
* Defaults to true. * Defaults to true.
...@@ -3219,6 +3220,7 @@ declare namespace monaco.editor { ...@@ -3219,6 +3220,7 @@ declare namespace monaco.editor {
readonly ariaLabel: string; readonly ariaLabel: string;
readonly renderLineNumbers: RenderLineNumbersType; readonly renderLineNumbers: RenderLineNumbersType;
readonly renderCustomLineNumbers: ((lineNumber: number) => string) | null; readonly renderCustomLineNumbers: ((lineNumber: number) => string) | null;
readonly displayBlankLastLineNumber: boolean;
readonly selectOnLineNumbers: boolean; readonly selectOnLineNumbers: boolean;
readonly glyphMargin: boolean; readonly glyphMargin: boolean;
readonly revealHorizontalRightPadding: number; readonly revealHorizontalRightPadding: number;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册