Sha256: 0ea25e5726dfa963b60832abd9aeae76bd0b6058de33e9792c2c848691e8b860

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

var CodeMirror = require("codemirror");

CodeMirror.commands.tabAndIndentMarkdownList = function (cm) {
	var ranges = cm.listSelections();
	var pos = ranges[0].head;
	var eolState = cm.getStateAfter(pos.line);
	var inList = eolState.list !== false;

	if (inList) {
		cm.execCommand("indentMore");
		return;
	}

	if (cm.options.indentWithTabs) {
		cm.execCommand("insertTab");
	}
	else {
		var spaces = Array(cm.options.tabSize + 1).join(" ");
		cm.replaceSelection(spaces);
	}
};

CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
	var ranges = cm.listSelections();
	var pos = ranges[0].head;
	var eolState = cm.getStateAfter(pos.line);
	var inList = eolState.list !== false;

	if (inList) {
		cm.execCommand("indentLess");
		return;
	}

	if (cm.options.indentWithTabs) {
		cm.execCommand("insertTab");
	}
	else {
		var spaces = Array(cm.options.tabSize + 1).join(" ");
		cm.replaceSelection(spaces);
	}
};

Version data entries

6 entries across 3 versions & 1 rubygems

Version Path
administrate-field-simple_mde_markdown-0.1.2 node_modules/simplemde/src/js/codemirror/tablist 2.js
administrate-field-simple_mde_markdown-0.1.2 node_modules/simplemde/src/js/codemirror/tablist.js
administrate-field-simple_mde_markdown-0.1.1 node_modules/simplemde/src/js/codemirror/tablist 2.js
administrate-field-simple_mde_markdown-0.1.1 node_modules/simplemde/src/js/codemirror/tablist.js
administrate-field-simple_mde_markdown-0.1.0 node_modules/simplemde/src/js/codemirror/tablist 2.js
administrate-field-simple_mde_markdown-0.1.0 node_modules/simplemde/src/js/codemirror/tablist.js