about summary refs log tree commit diff stats
path: root/bonus
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-14 20:41:08 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-14 20:41:57 +0100
commita8f05f18fdd64485c26b453e62e8073b50e271ef (patch)
tree855b2ba978707197c69338bd5ae6a937d05332a4 /bonus
parentb5c7a63a3dccf0ea7490d635ee5a8d56d3d49ce1 (diff)
downloadchawan-a8f05f18fdd64485c26b453e62e8073b50e271ef.tar.gz
pager: add "open in editor" keybinding (sE)
only for source for now, rendered document is a bit more complicated

(also, get rid of useless extern/editor module)
Diffstat (limited to 'bonus')
-rw-r--r--bonus/w3m.toml10
1 files changed, 9 insertions, 1 deletions
diff --git a/bonus/w3m.toml b/bonus/w3m.toml
index 7cc07ef5..3ed27cf9 100644
--- a/bonus/w3m.toml
+++ b/bonus/w3m.toml
@@ -59,7 +59,15 @@ v = 'pager.toggleSource()'
 #TODO edit
 C-l = 'pager.redraw()'
 R = 'pager.reload()'
-#TODO save, save source, view in editor
+#TODO save, save source
+E = '''
+() => {
+	if (pager.url.protocol == "file:")
+		pager.extern(pager.getEditorCommand(pager.url.pathname))
+	else
+		pager.alert("Can't edit other than local file");
+}
+'''
 #TODO buffer selection mode
 'C-@' = '''
 () => {