mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
parent
2a6c4b04b1
commit
24ce415283
@ -2575,3 +2575,15 @@ describe "Editor", ->
|
||||
editor.on 'editor:will-be-removed', willBeRemovedHandler
|
||||
editor.getPane().destroyActiveItem()
|
||||
expect(willBeRemovedHandler).toHaveBeenCalled()
|
||||
|
||||
|
||||
describe "when setInvisibles is toggled (regression)", ->
|
||||
it "renders inserted newlines properly", ->
|
||||
editor.setShowInvisibles(true)
|
||||
editor.setCursorBufferPosition([0, 0])
|
||||
editor.attachToDom(heightInLines: 20)
|
||||
editor.setShowInvisibles(false)
|
||||
editor.insertText("\n")
|
||||
|
||||
for rowNumber in [1..5]
|
||||
expect(editor.lineElementForScreenRow(rowNumber).text()).toBe buffer.lineForRow(rowNumber)
|
||||
|
@ -826,6 +826,14 @@ class Editor extends View
|
||||
@activeEditSession.on "grammar-changed.editor", =>
|
||||
@trigger 'editor:grammar-changed'
|
||||
|
||||
@activeEditSession.on 'selection-added.editor', (selection) =>
|
||||
@newCursors.push(selection.cursor)
|
||||
@newSelections.push(selection)
|
||||
@requestDisplayUpdate()
|
||||
|
||||
@activeEditSession.on 'screen-lines-changed.editor', (e) =>
|
||||
@handleScreenLinesChange(e)
|
||||
|
||||
@trigger 'editor:path-changed'
|
||||
@resetDisplay()
|
||||
|
||||
@ -1178,14 +1186,6 @@ class Editor extends View
|
||||
@removeAllCursorAndSelectionViews()
|
||||
@updateLayerDimensions()
|
||||
@setScrollPositionFromActiveEditSession()
|
||||
|
||||
@activeEditSession.on 'selection-added.editor', (selection) =>
|
||||
@newCursors.push(selection.cursor)
|
||||
@newSelections.push(selection)
|
||||
@requestDisplayUpdate()
|
||||
|
||||
@activeEditSession.on 'screen-lines-changed.editor', (e) => @handleScreenLinesChange(e)
|
||||
|
||||
@newCursors = @activeEditSession.getCursors()
|
||||
@newSelections = @activeEditSession.getSelections()
|
||||
@updateDisplay(suppressAutoScroll: true)
|
||||
|
Loading…
Reference in New Issue
Block a user