editor context menu, focus fix

This commit is contained in:
Jan Prochazka
2021-03-11 07:53:37 +01:00
parent 5f97f7d922
commit c193955fbe
6 changed files with 91 additions and 12 deletions

View File

@@ -17,10 +17,24 @@
if (key.startsWith('archive://')) return 'icon archive';
return 'icon file';
}
registerCommand({
id: 'tabs.nextTab',
category: 'Tabs',
name: 'Next tab',
keyText: 'Ctrl+Tab',
enabledStore: derived(openedTabs, tabs => tabs.filter(x => !x.closedTime).length >= 2),
onClick: () => {
const tabs = get(openedTabs).filter(x => x.closedTime == null);
if (tabs.length >= 2) setSelectedTab(tabs[tabs.length - 2].tabid);
},
});
</script>
<script lang="ts">
import _ from 'lodash';
import { derived, get } from 'svelte/store';
import registerCommand from '../commands/registerCommand';
import FontIcon from '../icons/FontIcon.svelte';
import { currentDatabase, openedTabs } from '../stores';