Inconsistent behaviour when deleting wrapped lines

I’ve noticed some inconsistent behaviour with the deleteLine command.

If the cursor is on the last “visual” line of a wrapped line then the cursor remains on the same line number. Note the active line number in the following screenshots before/after triggering deleteLine.

Before:

After:


If the cursor is on any other “visual” line then the cursor moved to the line number above. Note the active line number in the following screenshots before/after triggering deleteLine.

Before:

After:

Here’s the sandbox link where I reproduced in Chrome, Firefox and Safari.

I wasn’t sure if this was an intentional behavioural choice or a bug? If it’s the latter then I’d be happy to move to the issue tracker.

This patch should help.

1 Like