Skip to content

Commit

Permalink
Extend TextEditorLineNumbersStyle with Interval (#13458)
Browse files Browse the repository at this point in the history
fixes #13447

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
  • Loading branch information
rschnekenbu authored Mar 19, 2024
1 parent 79a3244 commit 82ada4b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## not yet released

- [core] Fix quickpick problems found in IDE testing [#13451](https://github.com/eclipse-theia/theia/pull/13451) - contributed on behalf of STMicroelectronics
- [plugin] Extend TextEditorLineNumbersStyle with Interval [#13458](https://github.com/eclipse-theia/theia/pull/13458) - contributed on behalf of STMicroelectronics

<a name="breaking_changes_not_yet_released">[Breaking Changes:](#breaking_changes_not_yet_released)</a>

Expand Down
8 changes: 7 additions & 1 deletion packages/plugin-ext/src/main/browser/text-editor-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,17 @@ export class TextEditorMain implements Disposable {
}

if (typeof newConfiguration.lineNumbers !== 'undefined') {
let lineNumbers: 'on' | 'off' | 'relative';
let lineNumbers: 'on' | 'off' | 'relative' | 'interval';
switch (newConfiguration.lineNumbers) {
case TextEditorLineNumbersStyle.On:
lineNumbers = 'on';
break;
case TextEditorLineNumbersStyle.Relative:
lineNumbers = 'relative';
break;
case TextEditorLineNumbersStyle.Interval:
lineNumbers = 'interval';
break;
default:
lineNumbers = 'off';
}
Expand Down Expand Up @@ -400,6 +403,9 @@ export class TextEditorPropertiesMain {
case monaco.editor.RenderLineNumbersType.Relative:
lineNumbers = TextEditorLineNumbersStyle.Relative;
break;
case monaco.editor.RenderLineNumbersType.Interval:
lineNumbers = TextEditorLineNumbersStyle.Interval;
break;
default:
lineNumbers = TextEditorLineNumbersStyle.On;
break;
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ export enum StatusBarAlignment {
export enum TextEditorLineNumbersStyle {
Off = 0,
On = 1,
Relative = 2
Relative = 2,
Interval = 3
}

/**
Expand Down
6 changes: 5 additions & 1 deletion packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,11 @@ export module '@theia/plugin' {
/**
* Render the line numbers with values relative to the primary cursor location.
*/
Relative = 2
Relative = 2,
/**
* Render the line numbers on every 10th line number.
*/
Interval = 3
}

/**
Expand Down

0 comments on commit 82ada4b

Please sign in to comment.