about summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-12 20:48:01 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-12 20:50:39 +0100
commita2155217494ef652bbd5fedf3f1e5441e991cd43 (patch)
tree0bbefdac5f5c6b52fe900d65ff251858325f8395 /res
parenta2eadfb39099b2e8bfd543f00d75b64916931959 (diff)
downloadchawan-a2155217494ef652bbd5fedf3f1e5441e991cd43.tar.gz
config.toml: C-c cancels setMark/gotoMark operations
Diffstat (limited to 'res')
-rw-r--r--res/config.toml24
1 files changed, 21 insertions, 3 deletions
diff --git a/res/config.toml b/res/config.toml
index 71e11d18..dfe4dcf9 100644
--- a/res/config.toml
+++ b/res/config.toml
@@ -112,9 +112,27 @@ C-b = 'n => pager.pageUp(n)'
 '>' = 'n => pager.pageRight(n)'
 C-e = 'n => pager.scrollDown(n)'
 C-y = 'n => pager.scrollUp(n)'
-m = 'async () => pager.setMark(await pager.askChar("m"))'
-'`' = 'async () => pager.gotoMark(await pager.askChar("`"))'
-"'" = "async () => pager.gotoMarkY(await pager.askChar(\"'\"))"
+m = '''
+async () => {
+	const c = await pager.askChar("m");
+	if (c.charCodeAt() != 3) /* ctrl-c */
+		pager.setMark(c);
+}
+'''
+'`' = '''
+async () => {
+	const c = await pager.askChar('`');
+	if (c.charCodeAt() != 3) /* C-c */
+		pager.gotoMark(c);
+}
+'''
+"'" = '''
+async () => {
+	const c = await pager.askChar('`');
+	if (c.charCodeAt() != 3) /* C-c */
+		pager.gotoMarkY(c);
+}
+'''
 'zh'= 'n => pager.scrollLeft(n)'
 'zl' = 'n => pager.scrollRight(n)'
 J = 'n => pager.scrollDown(n)'