Explorar o código

Merge pull request #2625 from overleaf/bg-fix-spelling-stateful-regexp

fix stateful regexp usage in SpellCheckManager

GitOrigin-RevId: 6ac93e6a9227a638b30882ce99771e30c1a097c1
Eric Mc Sween %!s(int64=6) %!d(string=hai) anos
pai
achega
130f97d621

+ 1 - 0
services/web/frontend/js/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.js

@@ -337,6 +337,7 @@ define([], function() {
         let rowIdx = changedRowNums[row]
         let rowIdx = changedRowNums[row]
         line = this.blankOutBlacklistedCommands(line)
         line = this.blankOutBlacklistedCommands(line)
         var result
         var result
+        WORD_REGEX.lastIndex = 0 // reset global stateful regexp for this usage
         while ((result = WORD_REGEX.exec(line))) {
         while ((result = WORD_REGEX.exec(line))) {
           let word = result[0]
           let word = result[0]
           if (word[0] === "'") {
           if (word[0] === "'") {