Skip to content

Commit f253874

Browse files
committed
add more clear-keys
1 parent 3848e0e commit f253874

File tree

4 files changed

+323
-278
lines changed

4 files changed

+323
-278
lines changed

dist/assets/index-691fe819.js renamed to dist/assets/index-550a80ac.js

Lines changed: 274 additions & 274 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link rel="icon" type="image/svg+xml" href="/lang-clojure-eval/assets/vite-4a748afd.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Vite App</title>
8-
<script type="module" crossorigin src="/lang-clojure-eval/assets/index-691fe819.js"></script>
8+
<script type="module" crossorigin src="/lang-clojure-eval/assets/index-550a80ac.js"></script>
99
<link rel="stylesheet" href="/lang-clojure-eval/assets/index-b8e05ab1.css">
1010
</head>
1111
<body>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lang-clojure-eval",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"author": "Bobbi Towers <[email protected]>",
55
"description": "Lezer-based Clojure Codemirror 6 extension with live evaluation",
66
"main": "dist/index.cjs",

src/eval-region.js

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,58 @@ function evalCell(view) {
175175
return true
176176
}
177177

178+
const alpha = Array.from(Array(58)).map((e, i) => i + 65);
179+
const alphabet = alpha.map((x) => String.fromCharCode(x));
180+
let letterKeys = []
181+
for (let i = 0; i < alphabet.length; i++) {
182+
letterKeys = letterKeys.concat({key: alphabet[i], run: clearEval})
183+
}
184+
178185
export const evalExtension =
179186
Prec.highest(keymap.of(
180187
[{key: "Shift-Enter", run: evalCell},
181-
{key: "Ctrl-Enter", mac: "Cmd-Enter", run: evalAtCursor},
188+
{key: "Mod-Enter", run: evalAtCursor},
182189
{key: "Alt-Enter", run: evalTopLevel},
183190
{key: "Escape", run: clearEval},
184191
{key: "ArrowLeft", run: clearEval},
185192
{key: "ArrowRight", run: clearEval},
186193
{key: "ArrowUp", run: clearEval},
187-
{key: "ArrowDown", run: clearEval}]))
194+
{key: "ArrowDown", run: clearEval},
195+
{key: "Backspace", run: clearEval},
196+
{key: "Enter", run: clearEval},
197+
{key: "Tab", run: clearEval},
198+
{key: "Delete", run: clearEval},
199+
{key: "0", run: clearEval},
200+
{key: "1", run: clearEval},
201+
{key: "2", run: clearEval},
202+
{key: "3", run: clearEval},
203+
{key: "4", run: clearEval},
204+
{key: "5", run: clearEval},
205+
{key: "6", run: clearEval},
206+
{key: "7", run: clearEval},
207+
{key: "8", run: clearEval},
208+
{key: "9", run: clearEval},
209+
{key: "!", run: clearEval},
210+
{key: "@", run: clearEval},
211+
{key: "#", run: clearEval},
212+
{key: "$", run: clearEval},
213+
{key: "%", run: clearEval},
214+
{key: "^", run: clearEval},
215+
{key: "&", run: clearEval},
216+
{key: "*", run: clearEval},
217+
{key: "-", run: clearEval},
218+
{key: "=", run: clearEval},
219+
{key: "+", run: clearEval},
220+
{key: "/", run: clearEval},
221+
{key: "`", run: clearEval},
222+
{key: "\"", run: clearEval},
223+
{key: "'", run: clearEval},
224+
{key: ";", run: clearEval},
225+
{key: ":", run: clearEval},
226+
{key: "[", run: clearEval},
227+
{key: "]", run: clearEval},
228+
{key: "{", run: clearEval},
229+
{key: "}", run: clearEval},
230+
{key: "(", run: clearEval},
231+
{key: ")", run: clearEval},
232+
{key: "Space", run: clearEval}].concat(letterKeys)))

0 commit comments

Comments
 (0)