mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-19 15:08:08 +03:00
Use type
instead of kind
This commit is contained in:
parent
e61b180777
commit
795c3b27aa
@ -6716,7 +6716,7 @@ describe('TextEditor', () => {
|
||||
const gutter = editor.addGutter(options)
|
||||
expect(editor.getGutters().length).toBe(2)
|
||||
expect(editor.getGutters()[1]).toBe(gutter)
|
||||
expect(gutter.kind).toBe('decorated')
|
||||
expect(gutter.type).toBe('decorated')
|
||||
})
|
||||
|
||||
it('can add a custom line-number gutter', () => {
|
||||
@ -6724,12 +6724,12 @@ describe('TextEditor', () => {
|
||||
const options = {
|
||||
name: 'another-gutter',
|
||||
priority: 2,
|
||||
kind: 'line-number'
|
||||
type: 'line-number'
|
||||
}
|
||||
const gutter = editor.addGutter(options)
|
||||
expect(editor.getGutters().length).toBe(2)
|
||||
expect(editor.getGutters()[1]).toBe(gutter)
|
||||
expect(gutter.kind).toBe('line-number')
|
||||
expect(gutter.type).toBe('line-number')
|
||||
})
|
||||
|
||||
it("does not allow a custom gutter with the 'line-number' name.", () => expect(editor.addGutter.bind(editor, {name: 'line-number'})).toThrow())
|
||||
|
@ -97,7 +97,7 @@ module.exports = class GutterContainer {
|
||||
|
||||
// The public interface is Gutter::decorateMarker or TextEditor::decorateMarker.
|
||||
addGutterDecoration (gutter, marker, options) {
|
||||
if (gutter.kind === 'line-number') {
|
||||
if (gutter.type === 'line-number') {
|
||||
options.type = 'line-number'
|
||||
} else {
|
||||
options.type = 'gutter'
|
||||
|
@ -11,7 +11,7 @@ module.exports = class Gutter {
|
||||
this.name = options && options.name
|
||||
this.priority = (options && options.priority != null) ? options.priority : DefaultPriority
|
||||
this.visible = (options && options.visible != null) ? options.visible : true
|
||||
this.kind = (options && options.kind != null) ? options.kind : 'decorated'
|
||||
this.type = (options && options.type != null) ? options.type : 'decorated'
|
||||
this.labelFn = options && options.labelFn
|
||||
|
||||
this.emitter = new Emitter()
|
||||
|
@ -3099,7 +3099,7 @@ class GutterContainerComponent {
|
||||
},
|
||||
$.div({style: innerStyle},
|
||||
guttersToRender.map((gutter) => {
|
||||
if (gutter.kind === 'line-number') {
|
||||
if (gutter.type === 'line-number') {
|
||||
return this.renderLineNumberGutter(gutter)
|
||||
} else {
|
||||
return $(CustomGutterComponent, {
|
||||
|
@ -258,7 +258,7 @@ class TextEditor {
|
||||
this.gutterContainer = new GutterContainer(this)
|
||||
this.lineNumberGutter = this.gutterContainer.addGutter({
|
||||
name: 'line-number',
|
||||
kind: 'line-number',
|
||||
type: 'line-number',
|
||||
priority: 0,
|
||||
visible: params.lineNumberGutterVisible
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user