Skip to content

Commit cf48d45

Browse files
committed
enable goto/symbols cache for unsaved editors
1 parent 2e923b1 commit cf48d45

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/runtime/goto.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Goto {
8585

8686
gotoSymbol({
8787
word,
88-
path: editor.getPath(),
88+
path: editor.getPath() || 'untitled-' + editor.getBuffer().getId(),
8989
// local context
9090
column: column + 1,
9191
row: row + 1,
@@ -142,7 +142,7 @@ class Goto {
142142
return new Promise((resolve, reject) => {
143143
gotoSymbol({
144144
word,
145-
path: textEditor.getPath(),
145+
path: textEditor.getPath() || 'untitled-' + textEditor.getBuffer().getId(),
146146
// local context
147147
column: column + 1,
148148
row: row + 1,

lib/runtime/outline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function updateEditor (editor, options = {
7979
const text = editor.getText()
8080
const currentModule = modules.current()
8181
const mod = currentModule ? currentModule : 'Main'
82-
const path = editor.getPath()
82+
const path = editor.getPath() || 'untitled-' + editor.getBuffer().getId()
8383
return updateeditor({
8484
text,
8585
mod,

0 commit comments

Comments
 (0)