Revert "Merge pull request #810 from pulsar-edit/fix-on-change-cursor-pos" #1035
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts commit 8c6bef4, reversing changes made to 4dd3293.
#810 caused a bug in the
Selection#deleteToBeginningOfLine
method:This happens because we're constructing a
Range
to decide which text gets deleted, but the beginning of the range is specified using a screen coordinate rather than a buffer coordinate.(Suppose you have a file with one line of content 160 characters wide, and you soft-wrap at 80. When you put the cursor on the second screen row,
textEditor.getLastCursor().getScreenRow()
will return1
;textEditor.getLastCursor().getBufferRow()
will return0
.)This explains why this bug didn't occur in the specs, and why the behavior of this command will vary based on where you are in the file. (And folks who've disabled
editor.softWrap
might not even notice this bug, since buffer and screen coordinates are identical when soft-wrap is disabled.)There are fixes we could apply short of reverting #810, but I'm proposing that we merge this in the short term so that we can at least point people at a rolling release if they complain about it.
In a couple days, we can figure out whether 1.118.1 is just a revert of #810… or a reapplication of #810 with fixes and more test coverage.