mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Editor handles changes to wrapped lines.
This commit is contained in:
@@ -67,6 +67,14 @@ describe "Editor", ->
|
||||
editor.cursor.setPosition([4, 0])
|
||||
expect(editor.cursor.position()).toEqual(editor.lines.find('pre:eq(5)').position())
|
||||
|
||||
# Many more tests for change events in the LineWrapper spec
|
||||
it "handles changes to wrapped lines correctly", ->
|
||||
buffer.insert([6, 28], '1234567')
|
||||
expect(editor.lines.find('.line:eq(7)').text()).toBe ' current < pivot ? left1234567.push(current) '
|
||||
expect(editor.lines.find('.line:eq(8)').text()).toBe ': right.push(current);'
|
||||
expect(editor.lines.find('.line:eq(9)').text()).toBe ' }'
|
||||
|
||||
|
||||
describe "cursor movement", ->
|
||||
describe ".setCursorPosition({row, column})", ->
|
||||
beforeEach ->
|
||||
|
||||
@@ -139,7 +139,7 @@ class Editor extends View
|
||||
@buffer.on 'change', (e) =>
|
||||
@cursor.bufferChanged(e)
|
||||
|
||||
@highlighter.on 'change', (e) =>
|
||||
@lineWrapper.on 'change', (e) =>
|
||||
{ oldRange, newRange } = e
|
||||
|
||||
if newRange.end.row > oldRange.end.row
|
||||
|
||||
Reference in New Issue
Block a user