mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add config.editor.invisibles field for customizing invisible glyphs.
This commit is contained in:
@@ -281,6 +281,10 @@ class Editor extends View
|
||||
@resetDisplay()
|
||||
|
||||
setInvisibles: (@invisibles={}) ->
|
||||
_.defaults @invisibles,
|
||||
eol: '¬',
|
||||
space: '•',
|
||||
tab: '▸'
|
||||
@resetDisplay()
|
||||
|
||||
checkoutHead: -> @getBuffer().checkoutHead()
|
||||
@@ -299,6 +303,7 @@ class Editor extends View
|
||||
|
||||
configure: ->
|
||||
@setShowInvisibles(config.editor.showInvisibles ? false)
|
||||
@setInvisibles(config.editor.invisibles)
|
||||
|
||||
handleEvents: ->
|
||||
config.on "update.editor#{@id}", => @configure()
|
||||
@@ -393,7 +398,6 @@ class Editor extends View
|
||||
@calculateDimensions()
|
||||
@hiddenInput.width(@charWidth)
|
||||
@setSoftWrapColumn() if @activeEditSession.getSoftWrap()
|
||||
@invisibles = @rootView()?.getInvisibles()
|
||||
$(window).on "resize.editor#{@id}", => @requestDisplayUpdate()
|
||||
@focus() if @isFocused
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ class RootView extends View
|
||||
extensions: null
|
||||
extensionStates: null
|
||||
fontSize: 20
|
||||
invisibles: null
|
||||
title: null
|
||||
|
||||
initialize: (pathToOpen, { @extensionStates, suppressOpen } = {}) ->
|
||||
@@ -43,11 +42,6 @@ class RootView extends View
|
||||
|
||||
TextMateTheme.activate(config.core.theme ? 'IR_Black')
|
||||
|
||||
@invisibles =
|
||||
eol: '¬'
|
||||
space: '•'
|
||||
tab: '▸'
|
||||
|
||||
@handleEvents()
|
||||
|
||||
if pathToOpen
|
||||
@@ -255,11 +249,5 @@ class RootView extends View
|
||||
|
||||
getFontSize: -> @fontSize
|
||||
|
||||
setInvisibles: (invisibles={}) ->
|
||||
_.extend(@invisibles, invisibles)
|
||||
editor.setInvisibles(@invisibles) for editor in @getEditors()
|
||||
|
||||
getInvisibles: -> @invisibles
|
||||
|
||||
saveAll: ->
|
||||
editor.save() for editor in @getEditors()
|
||||
|
||||
Reference in New Issue
Block a user