mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Merge pull request #12469 from atom/mb-fix-tab-length-deserialization
Fix tab length deserialization
This commit is contained in:
@@ -70,6 +70,7 @@ describe "TextEditor", ->
|
||||
expect(editor2.getSoftWrapHangingIndentLength()).toBe(editor.getSoftWrapHangingIndentLength())
|
||||
expect(editor2.getInvisibles()).toEqual(editor.getInvisibles())
|
||||
expect(editor2.getEditorWidthInChars()).toBe(editor.getEditorWidthInChars())
|
||||
expect(editor2.displayLayer.tabLength).toBe(editor2.getTabLength())
|
||||
|
||||
describe "when the editor is constructed with the largeFileMode option set to true", ->
|
||||
it "loads the editor but doesn't tokenize", ->
|
||||
|
||||
@@ -102,6 +102,7 @@ class TextEditor extends Model
|
||||
|
||||
try
|
||||
state.tokenizedBuffer = TokenizedBuffer.deserialize(state.tokenizedBuffer, atomEnvironment)
|
||||
state.tabLength = state.tokenizedBuffer.getTabLength()
|
||||
catch error
|
||||
if error.syscall is 'read'
|
||||
return # Error reading the file, don't deserialize an editor for it
|
||||
@@ -360,7 +361,7 @@ class TextEditor extends Model
|
||||
atomicSoftTabs: @displayLayer.atomicSoftTabs
|
||||
softWrapHangingIndentLength: @displayLayer.softWrapHangingIndent
|
||||
|
||||
@id, @softTabs, @tabLength, @softWrapped, @softWrapAtPreferredLineLength,
|
||||
@id, @softTabs, @softWrapped, @softWrapAtPreferredLineLength,
|
||||
@preferredLineLength, @mini, @editorWidthInChars, @width, @largeFileMode,
|
||||
@registered, @invisibles, @showInvisibles, @showIndentGuide
|
||||
}
|
||||
@@ -701,8 +702,9 @@ class TextEditor extends Model
|
||||
selectionsMarkerLayer = displayLayer.getMarkerLayer(@buffer.getMarkerLayer(@selectionsMarkerLayer.id).copy().id)
|
||||
softTabs = @getSoftTabs()
|
||||
new TextEditor({
|
||||
@buffer, selectionsMarkerLayer, @tabLength, softTabs,
|
||||
@buffer, selectionsMarkerLayer, softTabs,
|
||||
suppressCursorCreation: true,
|
||||
tabLength: @tokenizedBuffer.getTabLength(),
|
||||
@firstVisibleScreenRow, @firstVisibleScreenColumn,
|
||||
@clipboard, @assert, displayLayer, grammar: @getGrammar()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user