Steps to Reproduce:
I think that https://github.com/Microsoft/vscode/issues/55780 would also help this problem (but they are certainly not mutually exclusive).
the issue still exists in 1.29.1 and on OSX
Just wanted to say this is possibly the most annoying bug for me right now, it really disrupts my workflow since doing multiple cursors operations and then undoing is very common. Please give this importance >_<
still an issue in 1.32.2
@builder7777 Rather than noticing that this issue still isn't fixed (which is obvious, it's still open 馃槢), I think that the VS Code team would welcome a pull request.
If you don't have time to do so (I don't), you can :+1: this issue and ask other people to do the same.
Hello, I'm in trouble with this issue too.
I investigated the code and found this is because of here:
https://github.com/Microsoft/vscode/blob/1afeb46cc4f2856ed6d0759fff85b13647c7ab83/src/vs/editor/common/controller/cursor.ts#L431-L436
Then, I looked for where this code came from and found that it was the very first commit of this repo:
https://github.com/Microsoft/vscode/commit/8f35cc4768393b25468416829e980d7550619fb1#diff-f8aa0da950270e2d56baecaf5819a4c5R871
but cannot find the reason from any commit messages or related test cases.
I tested and confirmed that this issue would be resolved if the else-clause shown above is removed.
I want to fix this and commit it, but don't know whether it's OK. There probably should be some discussions on such a fundamental behavior.
How do you think, @alexandrudima ?
The below is just my opinion about that:
I think there should be else-if-clause to catch the case revealTarget === RevealTarget.Primary in which the primary cursor is revealed even when there are multi cursors like this:
} else if (revealTarget === RevealTarget.Primary) {
// Do nothing. viewPosition to reveal is viewPositions[0] and it is already set.
} else {
if (viewPositions.length > 1) {
// no revealing!
return;
}
}
RevealTarget.Primary is currently handled by the else-clause in which revealing is disabled for multi-cursor mode, but if that option is specified, I want it to reveal the primary cursor even in multi-cursor mode.
Moreover, handling RevealTarget.Primary in the else-clause currently works well since an enum revealTarget has only Primary aside from TopMost and BottomMost, which are handled by if-clauses above the else-clause, but this can be a potential bug when there are more enum items in revealTarget.
The issue still exists.
almost 4 years later, still here in version 1.41.1.
I created a PR for this issue.
I hope it will be merged, or if not, a discussion will start.
With bc5d1b1d0559ab081df847b5ce84ca1621d158e2, I have pushed a change that in the multicursor case, a conceptional rectangle/bounding box is computed around all the cursors.
If the bounding box fits in the viewport, it is revealed, but if the bounding box does not fit in the viewport, the editor does not scroll.
Still doesn't work for me. Can someone confirm that it is fixed?
@borishere Are you using insiders? Stable does not have that change yet.
@alexdima I'm using a stable version. Thanks for clarification.
Still doesn't work for me too
Most helpful comment
Hello, I'm in trouble with this issue too.
I investigated the code and found this is because of here:
https://github.com/Microsoft/vscode/blob/1afeb46cc4f2856ed6d0759fff85b13647c7ab83/src/vs/editor/common/controller/cursor.ts#L431-L436
Then, I looked for where this code came from and found that it was the very first commit of this repo:
https://github.com/Microsoft/vscode/commit/8f35cc4768393b25468416829e980d7550619fb1#diff-f8aa0da950270e2d56baecaf5819a4c5R871
but cannot find the reason from any commit messages or related test cases.
I tested and confirmed that this issue would be resolved if the else-clause shown above is removed.
I want to fix this and commit it, but don't know whether it's OK. There probably should be some discussions on such a fundamental behavior.
How do you think, @alexandrudima ?
The below is just my opinion about that:
I think there should be else-if-clause to catch the case
revealTarget === RevealTarget.Primaryin which the primary cursor is revealed even when there are multi cursors like this:RevealTarget.Primaryis currently handled by the else-clause in which revealing is disabled for multi-cursor mode, but if that option is specified, I want it to reveal the primary cursor even in multi-cursor mode.Moreover, handling
RevealTarget.Primaryin the else-clause currently works well since an enumrevealTargethas onlyPrimaryaside fromTopMostandBottomMost, which are handled by if-clauses above the else-clause, but this can be a potential bug when there are more enum items inrevealTarget.