docs: fix custom event example

This commit is contained in:
Wez Furlong committed 2021-01-01 20:07:46 -08:00
1 parent b8cabc50bc
commit 386032bdee
1 file changed
+4 -4
+4 -4
View File
@@ -39,12 +39,12 @@ in response to clicking on `mailto:` URLs, you could do something like:
local wezterm = require 'wezterm';
wezterm.on("open-uri", function(window, pane, uri)
local start, end = uri:find("mailto:")
local start, match_end = uri:find("mailto:")
if start == 1 then
local recipient = uri:sub(end+1)
window.perform_action(wezterm.action{SpawnCommandInNewWindow={
local recipient = uri:sub(match_end+1)
window:perform_action(wezterm.action{SpawnCommandInNewWindow={
args={"mutt", recipient}
}});
}}, pane);
-- prevent the default action from opening in a browser
return false
end