Open eyalroth opened 5 years ago
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
This is as designed... The copy line down action is implemented by inserting the line text above it, so that's why the breakpoint moves. We will not reimplement the action just to accommodate this case, and it is IMHO not clearly wrong...
@alexandrudima This really doesn't seem to be as designed but rather a clear oversight, and for multiple reasons:
I wouldn't say that keeping the breakpoint, bookmark, or any other decoration/data in the original line is correct either, because the command is Copy Line Up/Down
, so users could expect that it should copy the breakpoint/bookmark/etc to the next/previous line, duplicating it.
I'm not sure if copying/cutting the entire line shouldn't bring its breakpoint/bookmarks (sometimes I hoped it should). But to this, the API should be updated to describe the original
Line
/Range
.
IMHO, I prefer the way it works today, even with this naming conflict. The Bookmarks extension, at least, should remain this way.
I think the copy line up/down action really should also copy all break points, bookmarks and other stuff associated to the line.
Unfortunately, as far as I know, there is no generic way to (deep-) copy all the associated data. For example, the bookmark extension might have its own data structure to manage the line-associated bookmarks.
Since copying the associated data is off the table, we can still control if the original or the copy should get all the associated data.
I think there are valid arguments for both the old (original) and the new (copied) line, so this is not clearly a bug, but rather the behavior is open for discussion.
Yes, the Bookmarks extension has its own storage, and a custom sticky algorithm to update the Bookmark position (line) when the user changes the file.
Technically speaking, ~I guess (I'm not in front of my computer)~ (confirmed) it works this way because the Copy Line Down
command, in fact, doesn't add a copy of the current line, in the next line (down). Instead, it adds the copy in the place of the current line, moving the so called current line, one line below. Doing so, the Bookmark follows the original line, going one line below, just like it does when you hit Return
at the beginning of the current line.
Version:
Steps to Reproduce:
Bug: The break-point moves with the copied line. It should stay.
Does this issue occur when all extensions are disabled? Yes