File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -310,6 +310,18 @@ Canvas* TabComponent::newPatch()
310310
311311void TabComponent::openHelpPatch (const URL& path)
312312{
313+ for (auto * editor : pd->getEditors ()) {
314+ for (auto * cnv : editor->getCanvases ()) {
315+ if (cnv->patch .getCurrentFile () == path.getLocalFile ()) {
316+ pd->logError (" Patch is already open" );
317+ editor->getTopLevelComponent ()->toFront (true );
318+ editor->getTabComponent ().showTab (cnv, cnv->patch .splitViewIndex );
319+ editor->getTabComponent ().setActiveSplit (cnv);
320+ return ;
321+ }
322+ }
323+ }
324+
313325 auto const patch = pd->loadPatch (path);
314326
315327 if (auto p = patch->getPointer ()) {
@@ -343,6 +355,7 @@ void TabComponent::openPatch(const URL& path)
343355 editor->getTopLevelComponent ()->toFront (true );
344356 editor->getTabComponent ().showTab (cnv, cnv->patch .splitViewIndex );
345357 editor->getTabComponent ().setActiveSplit (cnv);
358+ return ;
346359 }
347360 }
348361 }
You can’t perform that action at this time.
0 commit comments