Skip to content

Commit 952c749

Browse files
devvaannshabose
authored andcommitted
fix: use 400 instead of 1000 for max repeat to prevent app freeze
1 parent 99514e2 commit 952c749

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/extensions/default/CSSCodeHints/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ define(function (require, exports, module) {
495495
// wrapped in try catch block because EXPAND_ABBR might throw error when it gets unexpected
496496
// characters such as `, =, etc
497497
try {
498-
let expandedAbbr = expandAbbr(needle, { syntax: "css", type: "stylesheet", maxRepeat: 1000 });
498+
let expandedAbbr = expandAbbr(needle, { syntax: "css", type: "stylesheet", maxRepeat: 400 });
499499
if (expandedAbbr && _isEmmetExpandable(needle, expandedAbbr)) {
500500

501501
// if the expandedAbbr doesn't have any numbers, we should split the expandedAbbr to,

src/extensions/default/HTMLCodeHints/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ define(function (require, exports, module) {
498498
) {
499499

500500
try {
501-
return expandAbbr(word, { syntax: "html", type: "markup", maxRepeat: 1000 }); // expanded
501+
return expandAbbr(word, { syntax: "html", type: "markup", maxRepeat: 400 }); // expanded
502502
} catch (error) {
503503

504504
// emmet api throws an error when abbr contains unclosed quotes, handling that case
@@ -510,7 +510,7 @@ define(function (require, exports, module) {
510510
const modifiedWord = word + nextChar;
511511

512512
try {
513-
return expandAbbr(modifiedWord, { syntax: "html", type: "markup", maxRepeat: 1000 });
513+
return expandAbbr(modifiedWord, { syntax: "html", type: "markup", maxRepeat: 400 });
514514
} catch (innerError) {
515515
// If it still fails, return false
516516
return null;

0 commit comments

Comments
 (0)