brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Fix edge case for #7075 where selection ends at beginning of last line of document #6436

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by njx Thursday Mar 06, 2014 at 21:41 GMT Originally opened as https://github.com/adobe/brackets/pull/7111


@redmunds - as I mentioned in email, this case is already fixed in the cmv4 version of the fix (so when I merge this over into cmv4 I'll just ignore this change, but keep the new unit test).

Note that there's an edge case of this edge case which is arguably still wrong :) - if the last line of the file is empty, then there's no way to delete it at the end of a block selection using Delete Line. I could imagine we add that as a special case - though it seems inconsistent, it might match what the user's intent usually is in this case. Let me know what you think.


njx included the following code: https://github.com/adobe/brackets/pull/7111/commits

core-ai-bot commented 3 years ago

Comment by redmunds Thursday Mar 06, 2014 at 22:47 GMT


if the last line of the file is empty, then there's no way to delete it at the end of a block selection using Delete Line

It seems to work on Win7. I start with a file with the following contents:

1
2
3
4
5
  1. Place cursor at beginning of line with "4"
  2. Press Ctrl-L 3 times to select the last 3 lines of file
  3. Press Ctrl-Shift-D

Results: Last 3 lines are deleted

Am I missing something?

core-ai-bot commented 3 years ago

Comment by njx Thursday Mar 06, 2014 at 23:19 GMT


If I follow those steps on this branch, the last (blank) line is still at the end of the file (the new line 4 is blank). Tried it on Windows and it's the same.

core-ai-bot commented 3 years ago

Comment by redmunds Thursday Mar 06, 2014 at 23:24 GMT


Oh, I guess I was reading it backwards :)

core-ai-bot commented 3 years ago

Comment by njx Thursday Mar 06, 2014 at 23:28 GMT


Yeah, that issue is introduced by this fix in order to keep the behavior consistent in all cases. Easy enough to add a special case if people find it annoying.

core-ai-bot commented 3 years ago

Comment by redmunds Thursday Mar 06, 2014 at 23:29 GMT


Merging.