Move-Line-Down doesn't move entire line below last line
Selecting an entire line (or lines) prevents editor:move-line-down to swap it
with the last line in the editor.
Note: It does work when not selecting the entire line (i.e. not selecting the newline char)

Repro Steps
- Open a file in the main editor
- Select an entire line or lines
- Use
editor:move-line-down(or defaultCtrl-Down) - Try to move it below the last line in the editor
Expected: The selected line swaps with the last line Actual: It doesn't do anything
Versions
- Atom: 1.0.0
- Electron: 0.22.3
- OS: linux 3.19.0-15-generic
- Misc
- apm 1.0.1
- npm 2.5.1
- node 0.10.35
- python 2.7.9
- git 2.1.4
This report was created using the package bug-report v0.7.1.
Was able to reproduce it on Windows 7 Atom 1.0.0.
Exactly as written above - occurs only when whole line is selected.
EDIT: Some more details added. Hope it helps.
Case A (no empty line at the end):

Case B (empty line at the end)

# text-editor.coffee
moveLineDown: ->
selection = @getSelectedBufferRange()
lastRow = @buffer.getLastRow()
return if selection.end.row is lastRow
# case A ends here ^^^^ ... selection.end.row is 1, lastRow is 1
return if selection.end.row is lastRow - 1 and @buffer.getLastLine() is ''
# case B ends here ^^^^ ... selection.end.row is 1, lastRow is 2, @buffer.getLastLine() is ''
Nice find, that's indeed the code that is causing this I think. The issue may be that selection.end of a fully selected line is on position 0 of the next line? That's where the cursor appears if you press right after selecting.
@stenverbois Yeah, indeed.
I have no idea if it should fixed in moveLineDown directly or deeper in code that is setting selection.end.row and if it is fixed deeper then I am not sure if it won't break something else.
That is the reason I am just writing about it :blush: . It also looks like there are no specs for moving lines :cold_sweat: .
This was fixed by #8232
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!