mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Rename getSoftWrapIndentLength -> getSoftWrapHangingIndentLength
This commit is contained in:
@@ -418,14 +418,14 @@ describe('TextEditorRegistry', function () {
|
||||
|
||||
it('sets the soft wrap indent length based on the config', function () {
|
||||
editor.update({softWrapHangingIndentLength: 4})
|
||||
expect(editor.getSoftWrapIndentLength()).toBe(4)
|
||||
expect(editor.getSoftWrapHangingIndentLength()).toBe(4)
|
||||
|
||||
atom.config.set('editor.softWrapHangingIndent', 2)
|
||||
registry.maintainConfig(editor)
|
||||
expect(editor.getSoftWrapIndentLength()).toBe(2)
|
||||
expect(editor.getSoftWrapHangingIndentLength()).toBe(2)
|
||||
|
||||
atom.config.set('editor.softWrapHangingIndent', 4)
|
||||
expect(editor.getSoftWrapIndentLength()).toBe(4)
|
||||
expect(editor.getSoftWrapHangingIndentLength()).toBe(4)
|
||||
})
|
||||
|
||||
it('enables or disables preferred line length-based soft wrap based on the config', function () {
|
||||
|
||||
@@ -5803,15 +5803,15 @@ describe "TextEditor", ->
|
||||
editor.setEditorWidthInChars(10)
|
||||
expect(editor.lineTextForScreenRow(0)).toBe 'var '
|
||||
|
||||
describe "::setSoftWrapIndentLength", ->
|
||||
describe "softWrapHangingIndentLength", ->
|
||||
it "controls how much extra indentation is applied to soft-wrapped lines", ->
|
||||
editor.setText('123456789')
|
||||
editor.setEditorWidthInChars(8)
|
||||
editor.setSoftWrapped(true)
|
||||
editor.setSoftWrapIndentLength(2)
|
||||
editor.update({softWrapHangingIndentLength: 2})
|
||||
expect(editor.lineTextForScreenRow(1)).toEqual ' 9'
|
||||
|
||||
editor.setSoftWrapIndentLength(4)
|
||||
editor.update({softWrapHangingIndentLength: 4})
|
||||
expect(editor.lineTextForScreenRow(1)).toEqual ' 9'
|
||||
|
||||
describe "::getElement", ->
|
||||
|
||||
@@ -153,6 +153,7 @@ class TextEditor extends Model
|
||||
@autoIndentOnPaste ?= true
|
||||
@undoGroupingInterval ?= 300
|
||||
@nonWordCharacters ?= "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-…"
|
||||
@softWrapHangingIndentLength ?= 0
|
||||
|
||||
@buffer ?= new TextBuffer
|
||||
@tokenizedBuffer ?= new TokenizedBuffer({
|
||||
@@ -371,7 +372,7 @@ class TextEditor extends Model
|
||||
ratioForCharacter: @ratioForCharacter.bind(this),
|
||||
isWrapBoundary: isWrapBoundary,
|
||||
foldCharacter: ZERO_WIDTH_NBSP,
|
||||
softWrapHangingIndent: @getSoftWrapIndentLength()
|
||||
softWrapHangingIndent: @getSoftWrapHangingIndentLength()
|
||||
})
|
||||
|
||||
destroyed: ->
|
||||
@@ -2859,9 +2860,7 @@ class TextEditor extends Model
|
||||
|
||||
setShowIndentGuide: (showIndentGuide) -> @update({showIndentGuide})
|
||||
|
||||
setSoftWrapIndentLength: (softWrapHangingIndentLength) -> @update({softWrapHangingIndentLength})
|
||||
|
||||
getSoftWrapIndentLength: -> @softWrapHangingIndentLength
|
||||
getSoftWrapHangingIndentLength: -> @softWrapHangingIndentLength
|
||||
|
||||
# Extended: Determine if the buffer uses hard or soft tabs.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user