- // Conversion to display string is necessary to deal with the '~' alias.
- // i.e. to acknowledge that ~/ is equivalent to /home/user/
- const QUrl tabUrl = tabPageAt(i)->activeViewContainer()->url();
- if (url == tabUrl ||
- url.toDisplayString(QUrl::StripTrailingSlash) == tabUrl.toDisplayString(QUrl::StripTrailingSlash)) {
- return i;
+ const auto tabPage = tabPageAt(i);
+ if (url == tabPage->primaryViewContainer()->url()) {
+ return qMakePair(i, true);
+ }
+
+ if (tabPage->splitViewEnabled() && url == tabPage->secondaryViewContainer()->url()) {
+ return qMakePair(i, false);