Add bdeletes! comand
This commit is contained in:
parent
c4fb6f0131
commit
9b3d12eb31
3 changed files with 12 additions and 1 deletions
|
@ -86,6 +86,8 @@ const exec = (tab, line, settings) => {
|
|||
return bufferCommand(args);
|
||||
case 'bdeletes':
|
||||
return tabs.closeTabsByKeywords(args.join(' '));
|
||||
case 'bdeletes!':
|
||||
return tabs.closeTabsByKeywordsForce(args.join(' '));
|
||||
case 'addbookmark':
|
||||
return addBookmarkCommand(tab, args).then((item) => {
|
||||
if (!item) {
|
||||
|
|
|
@ -89,6 +89,7 @@ const getCompletions = (line, settings) => {
|
|||
case 'b':
|
||||
case 'buffer':
|
||||
case 'bdeletes':
|
||||
case 'bdeletes!':
|
||||
return tabs.getCompletions(keywords).then((gotTabs) => {
|
||||
let items = gotTabs.map((tab) => {
|
||||
return {
|
||||
|
|
|
@ -13,6 +13,13 @@ const closeTabForce = (id) => {
|
|||
};
|
||||
|
||||
const closeTabsByKeywords = (keyword) => {
|
||||
tabCompletions.getCompletions(keyword).then((tabs) => {
|
||||
let tabs2 = tabs.filter(tab => !tab.pinned);
|
||||
browser.tabs.remove(tabs2.map(tab => tab.id));
|
||||
});
|
||||
};
|
||||
|
||||
const closeTabsByKeywordsForce = (keyword) => {
|
||||
tabCompletions.getCompletions(keyword).then((tabs) => {
|
||||
browser.tabs.remove(tabs.map(tab => tab.id));
|
||||
});
|
||||
|
@ -127,7 +134,8 @@ const duplicate = (id) => {
|
|||
};
|
||||
|
||||
export {
|
||||
closeTab, closeTabForce, closeTabsByKeywords, reopenTab, selectAt, selectByKeyword,
|
||||
closeTab, closeTabForce, closeTabsByKeywords, closeTabsByKeywordsForce,
|
||||
reopenTab, selectAt, selectByKeyword,
|
||||
selectPrevTab, selectNextTab, selectFirstTab,
|
||||
selectLastTab, selectTab, reload, updateTabPinned,
|
||||
toggleTabPinned, duplicate
|
||||
|
|
Reference in a new issue