diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-17 16:55:16 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-17 16:55:16 +0200 |
commit | 8b604e06c4ab305ef18faa0df67d0223897265e1 (patch) | |
tree | 49e537d9e8957d831d36de4b3ef74e9285a09ba8 /src/app.c | |
parent | 90a0a0a2913dcc38f18c6d85849d3bde9dfbaa26 (diff) |
App: Fixed links opening in the wrong split
Switching the current root may change which DocumentWidget the `open` command affects.
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2743,13 +2743,14 @@ iBool handleCommand_App(const char *cmd) { | |||
2743 | root = otherRoot_Window(as_Window(d->window), root); | 2743 | root = otherRoot_Window(as_Window(d->window), root); |
2744 | setKeyRoot_Window(as_Window(d->window), root); | 2744 | setKeyRoot_Window(as_Window(d->window), root); |
2745 | setCurrent_Root(root); /* need to change for widget creation */ | 2745 | setCurrent_Root(root); /* need to change for widget creation */ |
2746 | doc = document_Command(cmd); /* may be different */ | ||
2746 | } | 2747 | } |
2747 | if (newTab & (new_OpenTabFlag | newBackground_OpenTabFlag)) { | 2748 | if (newTab & (new_OpenTabFlag | newBackground_OpenTabFlag)) { |
2748 | doc = newTab_App(NULL, (newTab & new_OpenTabFlag) != 0); /* `newtab:2` to open in background */ | 2749 | doc = newTab_App(NULL, (newTab & new_OpenTabFlag) != 0); /* `newtab:2` to open in background */ |
2749 | } | 2750 | } |
2750 | iHistory *history = history_DocumentWidget(doc); | 2751 | iHistory *history = history_DocumentWidget(doc); |
2751 | const iBool isHistory = argLabel_Command(cmd, "history") != 0; | 2752 | const iBool isHistory = argLabel_Command(cmd, "history") != 0; |
2752 | int redirectCount = argLabel_Command(cmd, "redirect"); | 2753 | int redirectCount = argLabel_Command(cmd, "redirect"); |
2753 | if (!isHistory) { | 2754 | if (!isHistory) { |
2754 | if (redirectCount) { | 2755 | if (redirectCount) { |
2755 | replace_History(history, url); | 2756 | replace_History(history, url); |