About selectLinesContainingCursors()


#1

0)Test

echo -e “111\n222\n333\n444\n555\n” > /tmp/test.txt && atom /tmp/test.txt


cursors position
l:c 

1:1   shift-down:  selected line1 111
1:2   shift-down:  selected line2 222
1:3   noselect:cut-lines

—> cut line1 to line3. As not expected for me.

core cut(and another)

1:1   shift-down:  selected line1 111
1:2   shift-down:  selected line2 222
1:3   ctrl-x

—> cut line1 to line2. (As expected)

atom.commands.add ‘atom-text-editor’, ‘noselect:cut-lines’, ->
editor = atom.workspace.getActiveTextEditor()
editor.selectLinesContainingCursors()
editor.cutSelectedText()

1)selectLinesContainingCursors

(first of all).
In this API, the following one row is chosen a lot.
Please tell me whether this is the correct behavior.

  1. simple question in text-editor-spec.coffee

1462: editor.setCursorBufferPosition([0, 2])
1463: editor.selectLinesContainingCursors()
1464: editor.selectLinesContainingCursors()
1465: expect(editor.getSelectedBufferRange()).toEqual [[0, 0], [2, 0]]

1463 and 1464 are the same. Is that correct?