未验证 提交 39f976c1 编写于 作者: J Johannes Rieken 提交者: GitHub

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
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册