Merge pull request #6633 from overleaf/jk-cm6-spelling-ignore-commands
[web] Ace/CM6 Spelling: don't send commands to backend GitOrigin-RevId: 7fbd14240facb71b6d110eb95e271b07fced76b1
This commit is contained in:
+4
@@ -389,6 +389,10 @@ class SpellCheckManager {
|
||||
WORD_REGEX.lastIndex = 0 // reset global stateful regexp for this usage
|
||||
while ((result = WORD_REGEX.exec(line))) {
|
||||
let word = result[0]
|
||||
// Skip latex commands, as they are ignored by the backend anyway
|
||||
if (word.slice(0, 1) === '\\') {
|
||||
continue
|
||||
}
|
||||
if (word[0] === "'") {
|
||||
word = word.slice(1)
|
||||
}
|
||||
|
||||
@@ -206,7 +206,9 @@ export default describe('SpellCheckManager', function () {
|
||||
this.adapter.getLineCount.returns(1)
|
||||
this.adapter.getFirstVisibleRowNum.returns(1)
|
||||
this.adapter.getLastVisibleRowNum.returns(1)
|
||||
this.adapter.getLinesByRows.returns(['Lorem ipsum dolor'])
|
||||
this.adapter.getLinesByRows.returns([
|
||||
'Lorem \\somecommand ipsum dolor \\othercommand',
|
||||
])
|
||||
})
|
||||
|
||||
it('hits the backend with all words at startup', function () {
|
||||
|
||||
Reference in New Issue
Block a user