Add config.editor.showInvisibles

This commit is contained in:
Nathan Sobo
2012-12-12 13:50:58 -08:00
parent d89549c58a
commit b3303bc21d
3 changed files with 25 additions and 4 deletions

View File

@@ -60,6 +60,7 @@ class Editor extends View
@id = Editor.idCounter++
@lineCache = []
@configure()
@bindKeys()
@handleEvents()
@cursorViews = []
@@ -296,7 +297,12 @@ class Editor extends View
scanInRange: (args...) -> @getBuffer().scanInRange(args...)
backwardsScanInRange: (args...) -> @getBuffer().backwardsScanInRange(args...)
configure: ->
@setShowInvisibles(config.editor.showInvisibles ? false)
handleEvents: ->
config.on "update.editor#{@id}", => @configure()
@on 'focus', =>
@hiddenInput.focus()
false
@@ -658,6 +664,7 @@ class Editor extends View
@destroyEditSessions()
$(window).off ".editor#{@id}"
config.off ".editor#{@id}"
rootView = @rootView()
rootView?.off ".editor#{@id}"
if @pane() then @pane().remove() else super