summaryrefslogtreecommitdiff
path: root/source/features/tab-to-indent.tsx
blob: a614f7991a86cd8797305686fbfc1686a585cc5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import onetime from 'onetime';
import {eventHandler} from 'indent-textarea';
import * as pageDetect from 'github-url-detection';

import features from '.';
import onCommentFieldKeydown from '../github-events/on-comment-field-keydown';

function init(): void {
	onCommentFieldKeydown(eventHandler);
}

void features.add({
	id: __filebasename,
	description: 'Enables <kbd>tab</kbd> and <kbd>shift+tab</kbd> for indentation in comment fields.',
	screenshot: 'https://user-images.githubusercontent.com/1402241/33802977-beb8497c-ddbf-11e7-899c-698d89298de4.gif'
}, {
	include: [
		pageDetect.hasRichTextEditor
	],
	waitForDomReady: false,
	init: onetime(init)
});