Bläddra i källkod

Merge pull request #2601 from overleaf/jpa-hotfix-autocomplete-deleted-docs

[autocomplete] ignore deleted docs for completion

GitOrigin-RevId: 9f39bbb90d443e7a1691ff5558742e4d12f4eb4d
nate stemen 6 år sedan
förälder
incheckning
3b70e080b1

+ 5 - 1
services/web/frontend/js/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.js

@@ -105,7 +105,11 @@ define([
               const commandName = match[1]
               const commandName = match[1]
               const result = []
               const result = []
               for (let file of Files.getTeXFiles()) {
               for (let file of Files.getTeXFiles()) {
-                if (file.id !== this.$scope.docId) {
+                if (
+                  file.id !== this.$scope.docId &&
+                  !file.deleted &&
+                  file.path
+                ) {
                   const { path } = file
                   const { path } = file
                   let cleanPath = path.replace(/(.+)\.tex$/i, '$1')
                   let cleanPath = path.replace(/(.+)\.tex$/i, '$1')
                   result.push({
                   result.push({