Skip to content

Commit

Permalink
Removes the double diagram request on opening VS Code with no editor …
Browse files Browse the repository at this point in the history
…in focus

During adoption to Sprotty 0.13 another way of updating the diagram was introduced that always requests a diagram when the editor is switched. When opening VS Code now with no editor in focus (e.g. when the diagram was in focus, which is not re-opened by VS Code by default), clicking on an editor triggered this newly introduced switch AND this now-removed code we had for exactly that use case. As this is now superfluous and causes duplicated requests, this removes that issue.
  • Loading branch information
NiklasRentzCAU committed Oct 23, 2024
1 parent de0720c commit 1e80ab3
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions applications/klighd-vscode/src/klighd-webview-reopener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2022-2023 by
* Copyright 2022-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand Down Expand Up @@ -35,19 +35,6 @@ export class KlighdWebviewReopener {
if (activeTextEditor) {
const uri = activeTextEditor.document.fileName
commands.executeCommand(command.diagramOpen, Uri.file(uri))
} else {
// Register this an active editor changed to open the diagram then.
this.toDispose.push(
window.onDidChangeActiveTextEditor((editor) => {
let uri
if (editor) {
uri = editor.document.uri
}
commands.executeCommand(command.diagramOpen, uri)
// Remove listener again
this.toDispose.forEach((element) => element.dispose())
})
)
}
}
}
Expand Down

0 comments on commit 1e80ab3

Please sign in to comment.