mirror of
https://github.com/atom/atom.git
synced 2026-02-18 18:34:21 -05:00
Set languageMode and softTabs in constructor, not setBuffer
The softTabs option is only in scope in the constructor, and it can sometimes be needed if we're unable to auto-determine the softTabs setting from the buffer.
This commit is contained in:
@@ -57,6 +57,9 @@ class EditSession
|
||||
@buildDisplayBuffer({tabLength})
|
||||
@addCursorAtScreenPosition([0, 0])
|
||||
|
||||
@languageMode = new LanguageMode(this, @buffer.getExtension())
|
||||
@softTabs = @buffer.usesSoftTabs() ? softTabs ? true
|
||||
|
||||
@state.on 'changed', ({key, newValue}) =>
|
||||
switch key
|
||||
when 'scrollTop'
|
||||
@@ -66,8 +69,6 @@ class EditSession
|
||||
|
||||
setBuffer: (@buffer) ->
|
||||
@buffer.retain()
|
||||
@languageMode = new LanguageMode(this, @buffer.getExtension())
|
||||
@softTabs = @buffer.usesSoftTabs() ? softTabs ? true
|
||||
@subscribe @buffer, "path-changed", =>
|
||||
project.setPath(path.dirname(@getPath())) unless project.getPath()?
|
||||
@trigger "title-changed"
|
||||
|
||||
Reference in New Issue
Block a user