diff options
author | bptato <nincsnevem662@gmail.com> | 2024-01-30 22:53:47 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-01-30 22:57:40 +0100 |
commit | c811ea41ded0381b63f0b6d0e5574ecd48a07638 (patch) | |
tree | 9e24b656b8756e7503c3b0cb7f3da34fdda0a158 /src/config | |
parent | e696b8b173adf47b9184fdbc690a3ea28acb744a (diff) | |
download | chawan-c811ea41ded0381b63f0b6d0e5574ecd48a07638.tar.gz |
config: append */* rule instead of prepending
+ actually use the result. Fixes default converters when no external mailcap exists.
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/config.nim | 6 | ||||
-rw-r--r-- | src/config/mailcap.nim | 8 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/config/config.nim b/src/config/config.nim index 96b78bb7..1d2592e1 100644 --- a/src/config/config.nim +++ b/src/config/config.nim @@ -389,12 +389,12 @@ proc getMailcap*(config: Config): tuple[mailcap: Mailcap, errs: seq[string]] = flags: {HTMLOUTPUT} )) if not found: - mailcap.insert(MailcapEntry( + mailcap.add(MailcapEntry( mt: "*", subt: "*", cmd: "xdg-open '%s'" - ), 0) - return (DefaultMailcap, errs) + )) + return (mailcap, errs) return (mailcap, errs) # We try to source mime types declared in config. diff --git a/src/config/mailcap.nim b/src/config/mailcap.nim index bc267764..fc75086d 100644 --- a/src/config/mailcap.nim +++ b/src/config/mailcap.nim @@ -32,14 +32,6 @@ type Mailcap* = seq[MailcapEntry] -const DefaultMailcap* = @[ - MailcapEntry( - mt: "*", - subt: "*", - cmd: "xdg-open '%s'" - ) -] - proc has(state: MailcapParser): bool {.inline.} = return not state.stream.atEnd |