From 02284958a1189ffcb10b34a4c3a02417f8136a4d Mon Sep 17 00:00:00 2001 From: Anson Bridges Date: Mon, 11 Aug 2025 22:24:05 -0700 Subject: Initialize git repo from local project files --- static/js/codemirror/tablist.js | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 static/js/codemirror/tablist.js (limited to 'static/js/codemirror/tablist.js') diff --git a/static/js/codemirror/tablist.js b/static/js/codemirror/tablist.js new file mode 100644 index 0000000..e6cf2d4 --- /dev/null +++ b/static/js/codemirror/tablist.js @@ -0,0 +1,44 @@ +// 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); + } +}; -- cgit v1.2.3