mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-02 07:53:55 +03:00
commit page hotkeys
This commit is contained in:
parent
37ec72121e
commit
55fdb08b83
@ -11,9 +11,11 @@
|
||||
import { log } from '$lib';
|
||||
import IconChevronUp from '$lib/components/icons/IconChevronUp.svelte';
|
||||
import IconChevronDown from '$lib/components/icons/IconChevronDown.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { unsubscribe } from '$lib/utils';
|
||||
|
||||
export let data: PageData;
|
||||
let { statuses, diffs, user, api, projectId, project } = data;
|
||||
let { statuses, diffs, user, api, projectId, project, hotkeys } = data;
|
||||
|
||||
let fullContext = false;
|
||||
let context = 3;
|
||||
@ -211,6 +213,17 @@
|
||||
if (isStagedAdded && isUnstagedDeleted) git.stage({ projectId, paths: [file] });
|
||||
})
|
||||
);
|
||||
|
||||
onMount(() =>
|
||||
unsubscribe(
|
||||
hotkeys.on('ArrowUp', () => selectPreviousFile()),
|
||||
hotkeys.on('Control+n', () => selectPreviousFile()),
|
||||
hotkeys.on('k', () => selectPreviousFile()),
|
||||
hotkeys.on('ArrowDown', () => selectNextFile()),
|
||||
hotkeys.on('Control+p', () => selectNextFile()),
|
||||
hotkeys.on('j', () => selectNextFile())
|
||||
)
|
||||
);
|
||||
</script>
|
||||
|
||||
<Dialog bind:this={connectToCloudDialog}>
|
||||
|
Loading…
Reference in New Issue
Block a user