Skip to content

Commit cd06f4a

Browse files
committed
Refactor new configuration options into quickpick
1 parent 03d2016 commit cd06f4a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/util/quickpicks/lineNumbers.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
'use strict';
77

8+
import { configuration } from '../configuration/config';
9+
import { defaults } from '../configuration/defaults';
810
import { GQuickPick } from './common';
911

1012
interface State {
@@ -17,11 +19,6 @@ interface State {
1719

1820
const title = 'Line Number Options';
1921

20-
const defaults = {
21-
start: 10,
22-
increment: 10,
23-
};
24-
2522
export class LineNumbersInput extends GQuickPick {
2623
private readonly _state;
2724

@@ -42,7 +39,9 @@ export class LineNumbersInput extends GQuickPick {
4239
title,
4340
step: 1,
4441
totalSteps: 2,
45-
value: this._state.start?.toString() || defaults.start.toString(),
42+
value: (
43+
configuration.getParam<number>('lineNumberer.defaultStart') ?? defaults.lineNumberer.defaultStart
44+
).toString(),
4645
prompt: 'Choose Start Number',
4746
validate: this.validate,
4847
shouldResume: this.shouldResume,
@@ -56,7 +55,10 @@ export class LineNumbersInput extends GQuickPick {
5655
title,
5756
step: 2,
5857
totalSteps: 2,
59-
value: this._state.increment?.toString() || defaults.increment.toString(),
58+
value: (
59+
configuration.getParam<number>('lineNumberer.defaultIncrement') ??
60+
defaults.lineNumberer.defaultIncrement
61+
).toString(),
6062
prompt: 'Choose Increment Number',
6163
validate: this.validate,
6264
shouldResume: this.shouldResume,

0 commit comments

Comments
 (0)