diff --git a/leoInteg.leo b/leoInteg.leo index 358d0a8..a55d724 100644 --- a/leoInteg.leo +++ b/leoInteg.leo @@ -5801,7 +5801,7 @@ public static TCPIP_DEFAULT_PROTOCOL: string = "ws://"; public static ERROR_PACKAGE_ID: number = 0; public static STARTING_PACKAGE_ID: number = 1; public static CLEANUP_DEBOUNCE_DELAY: number = 40; -public static DETACHED_LANGUAGE_DELAY: number = 350; +public static DETACHED_LANGUAGE_DELAY: number = 300; public static DOCUMENTS_DEBOUNCE_DELAY: number = 80; public static BUTTONS_DEBOUNCE_DELAY: number = 80; public static UNDOS_DEBOUNCE_DELAY: number = 180; @@ -21698,6 +21698,7 @@ public _onTabsChanged(p_event: vscode.TabChangeEvent): void { const q_foundResults: Array<Promise<LeoBridgePackage>> = []; const w_sentFoundTabs: Array<vscode.Tab> = []; const w_sentFoundUri: Array<vscode.Uri> = []; + let w_hasDetached = false; for (const p_tabGroup of vscode.window.tabGroups.all) { for (const p_tab of p_tabGroup.tabs) { @@ -21712,6 +21713,7 @@ public _onTabsChanged(p_event: vscode.TabChangeEvent): void { if (!this._refreshType.excludeDetached && this._refreshType.body && id === c_id) { // console.log('fire refresh DETACHED in _refreshDetachedBodies'); this._leoDetachedFileSystem.fireRefreshFile(`${id}/${gnx}`); + w_hasDetached = true; } // if refresh tree is true, validate that opened detached of same commander still valid and close as needed. @@ -21748,6 +21750,9 @@ public _onTabsChanged(p_event: vscode.TabChangeEvent): void { } } + if (w_hasDetached && this._refreshType.tree) { + this.refreshCommanderDetachedLanguage(); // May have moved outside of language specific outline + } this._refreshType.excludeDetached = false; if (q_foundResults.length) { diff --git a/src/constants.ts b/src/constants.ts index d0db49e..a7c2b7a 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -63,7 +63,7 @@ export class Constants { public static ERROR_PACKAGE_ID: number = 0; public static STARTING_PACKAGE_ID: number = 1; public static CLEANUP_DEBOUNCE_DELAY: number = 40; - public static DETACHED_LANGUAGE_DELAY: number = 350; + public static DETACHED_LANGUAGE_DELAY: number = 300; public static DOCUMENTS_DEBOUNCE_DELAY: number = 80; public static BUTTONS_DEBOUNCE_DELAY: number = 80; public static UNDOS_DEBOUNCE_DELAY: number = 180; diff --git a/src/leoIntegration.ts b/src/leoIntegration.ts index e61a78f..046162a 100644 --- a/src/leoIntegration.ts +++ b/src/leoIntegration.ts @@ -2743,6 +2743,7 @@ export class LeoIntegration { const q_foundResults: Array> = []; const w_sentFoundTabs: Array = []; const w_sentFoundUri: Array = []; + let w_hasDetached = false; for (const p_tabGroup of vscode.window.tabGroups.all) { for (const p_tab of p_tabGroup.tabs) { @@ -2757,6 +2758,7 @@ export class LeoIntegration { if (!this._refreshType.excludeDetached && this._refreshType.body && id === c_id) { // console.log('fire refresh DETACHED in _refreshDetachedBodies'); this._leoDetachedFileSystem.fireRefreshFile(`${id}/${gnx}`); + w_hasDetached = true; } // if refresh tree is true, validate that opened detached of same commander still valid and close as needed. @@ -2793,6 +2795,9 @@ export class LeoIntegration { } } + if (w_hasDetached && this._refreshType.tree) { + this.refreshCommanderDetachedLanguage(); // May have moved outside of language specific outline + } this._refreshType.excludeDetached = false; if (q_foundResults.length) {