mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
Editor updates lines when it is resized
This commit is contained in:
parent
f6e9d99865
commit
22548141d7
@ -417,6 +417,14 @@ describe "Editor", ->
|
||||
else
|
||||
expect(marginBottom).toBe '0px'
|
||||
|
||||
it "renders additional lines when the editor is resized", ->
|
||||
setEditorHeightInLines(editor, 10)
|
||||
$(window).trigger 'resize'
|
||||
|
||||
expect(editor.lines.find('.line').length).toBe 10
|
||||
expect(editor.lines.find('.line:first').text()).toBe buffer.lineForRow(0)
|
||||
expect(editor.lines.find('.line:last').text()).toBe buffer.lineForRow(9)
|
||||
|
||||
describe "gutter rendering", ->
|
||||
it "creates a line number element for each line in the buffer", ->
|
||||
expect(editor.gutter.find('.line-number').length).toEqual(buffer.numLines())
|
||||
|
@ -210,6 +210,9 @@ class Editor extends View
|
||||
else
|
||||
@gutter.addClass('drop-shadow')
|
||||
|
||||
$(window).on "resize", =>
|
||||
@updateLines()
|
||||
|
||||
afterAttach: (onDom) ->
|
||||
return if @attached or not onDom
|
||||
@attached = true
|
||||
|
Loading…
Reference in New Issue
Block a user