From 26e8968a6499742cf37e00292a7d1c8ed620cad5 Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 19 May 2023 01:50:17 +0200 Subject: Add display/output encoding Some encodings are still missing --- src/config/config.nim | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/config') diff --git a/src/config/config.nim b/src/config/config.nim index e7bb0c63..45c177ad 100644 --- a/src/config/config.nim +++ b/src/config/config.nim @@ -67,6 +67,7 @@ type wrap*: bool EncodingConfig = object + display_charset*: Option[Charset] document_charset*: seq[Charset] ExternalConfig = object @@ -292,7 +293,6 @@ proc parseConfigValue(x: var Option[ColorMode], v: TomlValue, k: string) proc parseConfigValue(x: var Option[FormatMode], v: TomlValue, k: string) proc parseConfigValue(x: var FormatMode, v: TomlValue, k: string) proc parseConfigValue(x: var RGBAColor, v: TomlValue, k: string) -proc parseConfigValue(x: var Option[bool], v: TomlValue, k: string) proc parseConfigValue[T](x: var Option[T], v: TomlValue, k: string) proc parseConfigValue(x: var ActionMap, v: TomlValue, k: string) proc parseConfigValue(x: var CSSConfig, v: TomlValue, k: string) @@ -413,24 +413,14 @@ proc parseConfigValue(x: var RGBAColor, v: TomlValue, k: string) = "' for key " & k) x = c.get -proc parseConfigValue(x: var Option[bool], v: TomlValue, k: string) = - typeCheck(v, {VALUE_STRING, VALUE_BOOLEAN}, k) - if v.vt == VALUE_STRING: - if v.s == "auto": - x = none(bool) - else: - raise newException(ValueError, "invalid value '" & v.s & - "' for key " & k) +proc parseConfigValue[T](x: var Option[T], v: TomlValue, k: string) = + if v.vt == VALUE_STRING and v.s == "auto": + x = none(T) else: - var y: bool + var y: T parseConfigValue(y, v, k) x = some(y) -proc parseConfigValue[T](x: var Option[T], v: TomlValue, k: string) = - var y: T - parseConfigValue(y, v, k) - x = some(y) - proc parseConfigValue(x: var ActionMap, v: TomlValue, k: string) = typeCheck(v, VALUE_TABLE, k) for kk, vv in v: -- cgit 1.4.1-2-gfad0 0'/>
path: root/doc/pydoc/ranger.gui.curses_shortcuts.html
blob: a4c31d549f8200506075ec1a9e9451acf87c36ba (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11