Skip to content

Commit 9a44531

Browse files
committed
fix flawed comparison, increase threshold
1 parent f918d52 commit 9a44531

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/editor/contrib/suggest/suggestWidget.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ export class SuggestWidget implements IDisposable {
170170
if (e.done) {
171171
// only store width or height value that have changed and also
172172
// only store changes that are above a certain threshold
173-
const threshold = Math.floor(this.getLayoutInfo().itemHeight / 3);
173+
const threshold = Math.floor(this.getLayoutInfo().itemHeight / 2);
174174
let { width, height } = this.element.size;
175175
if (persistedSize && currentSize) {
176-
if (!persistHeight || Math.abs(currentSize.height - height) > threshold) {
176+
if (!persistHeight || Math.abs(currentSize.height - height) <= threshold) {
177177
height = persistedSize.height;
178178
}
179-
if (!persistWidth || Math.abs(currentSize.width - width) > threshold) {
179+
if (!persistWidth || Math.abs(currentSize.width - width) <= threshold) {
180180
width = persistedSize.width;
181181
}
182182
}

0 commit comments

Comments
 (0)