Use type instead of kind

This commit is contained in:
Ash Wilson 2018-07-24 09:53:14 -04:00
parent e61b180777
commit 795c3b27aa
No known key found for this signature in database
GPG Key ID: 81B1DDB704F69D2A
5 changed files with 7 additions and 7 deletions

View File

@ -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())

View File

@ -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'

View File

@ -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()

View File

@ -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, {

View File

@ -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
})