Add editor.showLineNumbers config option

Also adds toggle-line-numbers command. Closes #377
This commit is contained in:
Corey Johnson
2013-03-25 10:38:06 -07:00
parent 7756f8e86d
commit ec4bb162c3
3 changed files with 12 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ class Editor extends View
fontSize: 20
showInvisibles: false
showIndentGuide: false
showLineNumbers: true
autoIndent: true
autoIndentOnPaste: false
nonWordCharacters: "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?-"
@@ -156,6 +157,7 @@ class Editor extends View
'editor:duplicate-line': @duplicateLine
'editor:toggle-indent-guide': => config.set('editor.showIndentGuide', !config.get('editor.showIndentGuide'))
'editor:save-debug-snapshot': @saveDebugSnapshot
'editor:toggle-line-numbers': => config.set('editor.showLineNumbers', !config.get('editor.showLineNumbers'))
documentation = {}
for name, method of editorBindings
@@ -316,6 +318,7 @@ class Editor extends View
backwardsScanInRange: (args...) -> @getBuffer().backwardsScanInRange(args...)
configure: ->
@observeConfig 'editor.showLineNumbers', (showLineNumbers) => @gutter.setShowLineNumbers(showLineNumbers)
@observeConfig 'editor.showInvisibles', (showInvisibles) => @setShowInvisibles(showInvisibles)
@observeConfig 'editor.showIndentGuide', (showIndentGuide) => @setShowIndentGuide(showIndentGuide)
@observeConfig 'editor.invisibles', (invisibles) => @setInvisibles(invisibles)