File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,10 +260,15 @@ async function run(
260260 if ( pathName ) {
261261 url = Url . join ( pathName , reqPath ) ;
262262 file = editorManager . getFile ( url , "uri" ) ;
263- } else if ( ! activeFile . uri ) {
263+ } else if ( ! activeFile . uri && filename === reqPath ) {
264264 file = activeFile ;
265265 }
266266
267+ if ( ! url && ! file ) {
268+ error ( reqId ) ;
269+ return ;
270+ }
271+
267272 // Handle extensionless URLs (e.g., "about" -> "about.html" or "about/index.html")
268273 if ( ! ext && pathName ) {
269274 // Try exact match first for extensionless files (LICENSE, README, etc.)
@@ -302,7 +307,7 @@ async function run(
302307 switch ( ext ) {
303308 case ".htm" :
304309 case ".html" :
305- if ( file && file . loaded && file . isUnsaved ) {
310+ if ( ! url || ( file && file . loaded && file . isUnsaved ) ) {
306311 sendHTML ( file . session ?. doc ?. toString ( ) , reqId ) ;
307312 } else {
308313 sendFileContent ( url , reqId , MIMETYPE_HTML ) ;
@@ -331,7 +336,7 @@ async function run(
331336 break ;
332337
333338 default :
334- if ( file && file . loaded && file . isUnsaved ) {
339+ if ( ! url || ( file && file . loaded && file . isUnsaved ) ) {
335340 sendText (
336341 file . session ?. doc ?. toString ( ) ,
337342 reqId ,
You can’t perform that action at this time.
0 commit comments