mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Fix bug where text typed into empty buffer was on the wrong line.
This commit is contained in:
@@ -874,6 +874,14 @@ describe "Editor", ->
|
||||
expect(editor).not.toMatchSelector ':focus'
|
||||
expect(editor.hiddenInput).toMatchSelector ':focus'
|
||||
|
||||
describe "construction", ->
|
||||
it "assigns an empty buffer and correctly handles text input (regression coverage)", ->
|
||||
editor = new Editor
|
||||
expect(editor.buffer.path).toBeUndefined()
|
||||
expect(editor.lines.find('.line').length).toBe 1
|
||||
editor.insertText('x')
|
||||
expect(editor.lines.find('.line').length).toBe 1
|
||||
|
||||
describe ".setBuffer(buffer)", ->
|
||||
it "sets the cursor to the beginning of the file", ->
|
||||
expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
|
||||
|
||||
@@ -45,7 +45,6 @@ class Editor extends View
|
||||
@handleEvents()
|
||||
@setBuffer(new Buffer)
|
||||
@autoIndent = true
|
||||
@lineCache = []
|
||||
|
||||
bindKeys: ->
|
||||
window.keymap.bindKeys '*:not(.editor *)',
|
||||
|
||||
Reference in New Issue
Block a user