Fix show/hide line numbers in editor

This commit is contained in:
Damien Guard
2016-08-30 13:20:17 -07:00
parent 9574a831b1
commit 9451ca0254
2 changed files with 14 additions and 0 deletions

View File

@@ -425,6 +425,19 @@ describe('TextEditorRegistry', function () {
expect(editor.hasAtomicSoftTabs()).toBe(true)
})
it('enables or disables line numbers based on the config', async function () {
editor.update({showLineNumbers: true})
expect(editor.showLineNumbers).toBe(true)
atom.config.set('editor.showLineNumbers', false)
registry.maintainConfig(editor)
await initialPackageActivation
expect(editor.showLineNumbers).toBe(false)
atom.config.set('editor.showLineNumbers', true)
expect(editor.showLineNumbers).toBe(true)
})
it('sets the invisibles based on the config', async function () {
const invisibles1 = {'tab': 'a', 'cr': false, eol: false, space: false}
const invisibles2 = {'tab': 'b', 'cr': false, eol: false, space: false}

View File

@@ -12,6 +12,7 @@ const EDITOR_PARAMS_BY_SETTING_KEY = [
['editor.tabLength', 'tabLength'],
['editor.invisibles', 'invisibles'],
['editor.showIndentGuide', 'showIndentGuide'],
['editor.showLineNumbers', 'showLineNumbers'],
['editor.softWrap', 'softWrapped'],
['editor.softWrapHangingIndent', 'softWrapHangingIndentLength'],
['editor.softWrapAtPreferredLineLength', 'softWrapAtPreferredLineLength'],