mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 05:28:19 -05:00
Merge pull request #53757 from itamark/cycle-out-of-param-hints-after-one
Close param hints if you reach out of bounds of list instead of cycling
This commit is contained in:
@@ -475,26 +475,29 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
|
||||
|
||||
next(): boolean {
|
||||
const length = this.hints.signatures.length;
|
||||
const last = (this.currentSignature % length) === (length - 1);
|
||||
|
||||
if (length < 2) {
|
||||
// If there is only one signature, or we're on last signature of list
|
||||
if (length < 2 || last) {
|
||||
this.cancel();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.currentSignature = (this.currentSignature + 1) % length;
|
||||
this.currentSignature++;
|
||||
this.render();
|
||||
return true;
|
||||
}
|
||||
|
||||
previous(): boolean {
|
||||
const length = this.hints.signatures.length;
|
||||
const first = this.currentSignature === 0;
|
||||
|
||||
if (length < 2) {
|
||||
if (length < 2 || first) {
|
||||
this.cancel();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.currentSignature = (this.currentSignature - 1 + length) % length;
|
||||
this.currentSignature--;
|
||||
this.render();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user