mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-07 23:59:22 +03:00
Retokenize when setTabLength() was called.
This commit is contained in:
parent
8cd217e50a
commit
857fd5eaf4
@ -3057,7 +3057,15 @@ describe "TextEditor", ->
|
||||
coffeeEditor.setCursorBufferPosition [0, 10]
|
||||
expect(coffeeEditor.getTabLength(coffeeEditor.scopesAtCursor())).toBe 4
|
||||
|
||||
it 'will retokenize when the tab length is updated', ->
|
||||
it 'will retokenize when the tab length is updated via .setTabLength()', ->
|
||||
expect(editor.getTabLength()).toBe 2
|
||||
expect(editor.tokenizedLineForScreenRow(5).tokens[0].firstNonWhitespaceIndex).toBe 2
|
||||
|
||||
editor.setTabLength(6)
|
||||
expect(editor.getTabLength()).toBe 6
|
||||
expect(editor.tokenizedLineForScreenRow(5).tokens[0].firstNonWhitespaceIndex).toBe 6
|
||||
|
||||
it 'will retokenize when the editor.tabLength setting is updated', ->
|
||||
expect(editor.getTabLength()).toBe 2
|
||||
expect(editor.tokenizedLineForScreenRow(5).tokens[0].firstNonWhitespaceIndex).toBe 2
|
||||
|
||||
|
@ -117,6 +117,7 @@ class TokenizedBuffer extends Model
|
||||
@tabLength ? atom.config.get(scopeDescriptor ? @grammarScopeDescriptor, 'editor.tabLength')
|
||||
|
||||
setTabLength: (@tabLength) ->
|
||||
@retokenizeLines()
|
||||
|
||||
setInvisibles: (invisibles) ->
|
||||
unless _.isEqual(invisibles, @invisibles)
|
||||
|
Loading…
Reference in New Issue
Block a user