diff --git a/scripts/when_feature.sh b/scripts/when_feature.sh index 3f6d7731..2bb435aa 100755 --- a/scripts/when_feature.sh +++ b/scripts/when_feature.sh @@ -9,7 +9,7 @@ commits=$(git log -S "$@" --oneline --all --reverse | cut -d ' ' -f 1) for commit in $commits do # get the tag for the commit - tag=$(git describe --tags $commit 2> /dev/null) + tag=$(git describe --tags "$commit" 2> /dev/null) # if the commit has a tag, break out of the loop if [ -n "$tag" ] @@ -18,8 +18,8 @@ do fi done -prestr=pre$(git rev-list --count $commit) +prestr=pre$(git rev-list --count "$commit") # replace the middle number in tag-number-commit with prestr # nb: there's an extra -g but I don't care enough -echo $tag | sed "s/\([^-]*\)-\([^-]*\)-\([^-]*\)/\1-$prestr-\3/" +echo "$tag" | sed "s/\([^-]*\)-\([^-]*\)-\([^-]*\)/\1-$prestr-\3/" diff --git a/src/excmds.ts b/src/excmds.ts index bbe2cd8f..aee5da3e 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -2641,12 +2641,11 @@ export async function tabpush(windowId?: number) { const tabId = await activeTabId() const winId = windowId ?? nextWindow.id const pos = await config.getAsync("tabopenpos") - switch (pos) { - case "last": - return browser.tabs.move(tabId, { index: -1, windowId: winId }) - default: - let index = (await activeTabOnWindow(winId)).index + 1 - return browser.tabs.move(tabId, { index: index, windowId: winId }) + if (pos == "last") { + return browser.tabs.move(tabId, { index: -1, windowId: winId }) + } else { + const index = (await activeTabOnWindow(winId)).index + 1 + return browser.tabs.move(tabId, { index, windowId: winId }) } } @@ -2708,12 +2707,11 @@ export async function tabgrab(id: string) { const windowId = (await browser.windows.getLastFocused({ windowTypes: ["normal"] })).id // Move window const pos = await config.getAsync("tabopenpos") - switch (pos) { - case "last": - return browser.tabs.move(tabid, { index: -1, windowId }) - default: - let index = (await activeTab()).index + 1 - return browser.tabs.move(tabid, { index: index, windowId }) + if (pos == "last") { + return browser.tabs.move(tabid, { index: -1, windowId }) + } else { + const index = (await activeTab()).index + 1 + return browser.tabs.move(tabid, { index, windowId }) } } diff --git a/src/lib/webext.ts b/src/lib/webext.ts index bce70268..00a67caf 100644 --- a/src/lib/webext.ts +++ b/src/lib/webext.ts @@ -87,7 +87,7 @@ export async function activeTab() { export async function activeTabOnWindow(windowId?: number) { return ( await browser.tabs.query({ - windowId: windowId, + windowId, active: true }) )[0]