mirror of https://github.com/lapce/lapce.git
set theme persist to file
This commit is contained in:
parent
844fd8b82e
commit
d9057685c2
|
@ -206,7 +206,7 @@ version = "1.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
|
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -497,6 +497,22 @@ dependencies = [
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "config"
|
||||||
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static 1.4.0",
|
||||||
|
"nom 5.1.2",
|
||||||
|
"rust-ini",
|
||||||
|
"serde 1.0.130",
|
||||||
|
"serde-hjson",
|
||||||
|
"serde_json",
|
||||||
|
"toml",
|
||||||
|
"yaml-rust",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "console"
|
name = "console"
|
||||||
version = "0.6.2"
|
version = "0.6.2"
|
||||||
|
@ -1916,7 +1932,7 @@ dependencies = [
|
||||||
"bitmaps",
|
"bitmaps",
|
||||||
"rand_core 0.5.1",
|
"rand_core 0.5.1",
|
||||||
"rand_xoshiro",
|
"rand_xoshiro",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"sized-chunks",
|
"sized-chunks",
|
||||||
"typenum",
|
"typenum",
|
||||||
"version_check",
|
"version_check",
|
||||||
|
@ -2077,7 +2093,7 @@ version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a98d245f26984add78277a5306ca0cf774863d4eddb4912b31d94ee3fa1a22d4"
|
checksum = "a98d245f26984add78277a5306ca0cf774863d4eddb4912b31d94ee3fa1a22d4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
|
@ -2129,7 +2145,7 @@ dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"num-derive",
|
"num-derive",
|
||||||
"num-traits 0.2.14",
|
"num-traits 0.2.14",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"url 1.7.2",
|
"url 1.7.2",
|
||||||
|
@ -2151,6 +2167,7 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bit-vec 0.5.1",
|
"bit-vec 0.5.1",
|
||||||
"cc",
|
"cc",
|
||||||
|
"config",
|
||||||
"crossbeam-channel 0.5.1",
|
"crossbeam-channel 0.5.1",
|
||||||
"crossbeam-utils 0.8.5",
|
"crossbeam-utils 0.8.5",
|
||||||
"directories",
|
"directories",
|
||||||
|
@ -2167,12 +2184,12 @@ dependencies = [
|
||||||
"lsp-types",
|
"lsp-types",
|
||||||
"parking_lot 0.11.2",
|
"parking_lot 0.11.2",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"strum 0.19.5",
|
"strum 0.19.5",
|
||||||
"strum_macros 0.19.4",
|
"strum_macros 0.19.4",
|
||||||
"tinyfiledialogs",
|
"tinyfiledialogs",
|
||||||
"toml 0.5.8 (git+https://github.com/lapce/toml-rs)",
|
"toml",
|
||||||
"tree-sitter",
|
"tree-sitter",
|
||||||
"tree-sitter-highlight",
|
"tree-sitter-highlight",
|
||||||
"tree-sitter-rust",
|
"tree-sitter-rust",
|
||||||
|
@ -2196,7 +2213,7 @@ dependencies = [
|
||||||
"languageserver-types",
|
"languageserver-types",
|
||||||
"memchr",
|
"memchr",
|
||||||
"parking_lot 0.11.2",
|
"parking_lot 0.11.2",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"xi-rope 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xi-rope 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"xi-rpc",
|
"xi-rpc",
|
||||||
|
@ -2215,9 +2232,9 @@ dependencies = [
|
||||||
"lsp-types",
|
"lsp-types",
|
||||||
"notify",
|
"notify",
|
||||||
"parking_lot 0.11.2",
|
"parking_lot 0.11.2",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"toml 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"toml",
|
||||||
"xi-core-lib",
|
"xi-core-lib",
|
||||||
"xi-rope 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xi-rope 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"xi-rpc",
|
"xi-rpc",
|
||||||
|
@ -2230,7 +2247,7 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"crossbeam-channel 0.5.1",
|
"crossbeam-channel 0.5.1",
|
||||||
"jsonrpc-lite",
|
"jsonrpc-lite",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2258,6 +2275,19 @@ version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lexical-core"
|
||||||
|
version = "0.7.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe"
|
||||||
|
dependencies = [
|
||||||
|
"arrayvec 0.5.2",
|
||||||
|
"bitflags",
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"ryu",
|
||||||
|
"static_assertions",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.101"
|
version = "0.2.101"
|
||||||
|
@ -2374,7 +2404,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "852e0dedfd52cc32325598b2631e0eba31b7b708959676a9f837042f276b09a2"
|
checksum = "852e0dedfd52cc32325598b2631e0eba31b7b708959676a9f837042f276b09a2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_repr",
|
"serde_repr",
|
||||||
"url 2.2.2",
|
"url 2.2.2",
|
||||||
|
@ -2733,6 +2763,17 @@ version = "0.1.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nom"
|
||||||
|
version = "5.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
|
||||||
|
dependencies = [
|
||||||
|
"lexical-core",
|
||||||
|
"memchr",
|
||||||
|
"version_check",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "7.0.0"
|
version = "7.0.0"
|
||||||
|
@ -3283,7 +3324,7 @@ dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"humantime",
|
"humantime",
|
||||||
"line-wrap",
|
"line-wrap",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"xml-rs",
|
"xml-rs",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3293,7 +3334,7 @@ version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
|
checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"toml 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"toml",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3303,7 +3344,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92"
|
checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"toml 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"toml",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3620,6 +3661,12 @@ dependencies = [
|
||||||
"xmlparser",
|
"xmlparser",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rust-ini"
|
||||||
|
version = "0.13.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-demangle"
|
name = "rustc-demangle"
|
||||||
version = "0.1.21"
|
version = "0.1.21"
|
||||||
|
@ -3748,6 +3795,12 @@ dependencies = [
|
||||||
"pest",
|
"pest",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde"
|
||||||
|
version = "0.8.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.130"
|
version = "1.0.130"
|
||||||
|
@ -3757,6 +3810,18 @@ dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde-hjson"
|
||||||
|
version = "0.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static 1.4.0",
|
||||||
|
"num-traits 0.1.43",
|
||||||
|
"regex",
|
||||||
|
"serde 0.8.23",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.130"
|
version = "1.0.130"
|
||||||
|
@ -3776,7 +3841,7 @@ checksum = "a7f9e390c27c3c0ce8bc5d725f6e4d30a29d26659494aa4b17535f7522c5c950"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3986,6 +4051,12 @@ dependencies = [
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "static_assertions"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stdweb"
|
name = "stdweb"
|
||||||
version = "0.4.20"
|
version = "0.4.20"
|
||||||
|
@ -4008,7 +4079,7 @@ checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.29",
|
"proc-macro2 1.0.29",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"syn 1.0.75",
|
"syn 1.0.75",
|
||||||
]
|
]
|
||||||
|
@ -4022,7 +4093,7 @@ dependencies = [
|
||||||
"base-x",
|
"base-x",
|
||||||
"proc-macro2 1.0.29",
|
"proc-macro2 1.0.29",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha1",
|
"sha1",
|
||||||
|
@ -4127,7 +4198,7 @@ dependencies = [
|
||||||
"lazy_static 1.4.0",
|
"lazy_static 1.4.0",
|
||||||
"lazycell",
|
"lazycell",
|
||||||
"plist",
|
"plist",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
|
@ -4147,7 +4218,7 @@ dependencies = [
|
||||||
"strum 0.21.0",
|
"strum 0.21.0",
|
||||||
"strum_macros 0.21.1",
|
"strum_macros 0.21.1",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"toml 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"toml",
|
||||||
"version-compare",
|
"version-compare",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -4303,15 +4374,8 @@ version = "0.5.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
|
checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"indexmap",
|
||||||
]
|
"serde 1.0.130",
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "toml"
|
|
||||||
version = "0.5.8"
|
|
||||||
source = "git+https://github.com/lapce/toml-rs#8afd5d2227add98e45703a084aab6cb46ffba506"
|
|
||||||
dependencies = [
|
|
||||||
"serde",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -4597,7 +4661,7 @@ dependencies = [
|
||||||
"idna 0.2.3",
|
"idna 0.2.3",
|
||||||
"matches",
|
"matches",
|
||||||
"percent-encoding 2.1.0",
|
"percent-encoding 2.1.0",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -4606,7 +4670,7 @@ version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
|
checksum = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"url 1.7.2",
|
"url 1.7.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5059,7 +5123,7 @@ version = "0.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7"
|
checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nom",
|
"nom 7.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -5078,13 +5142,13 @@ dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
"notify",
|
"notify",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2 0.8.2",
|
"sha2 0.8.2",
|
||||||
"syntect",
|
"syntect",
|
||||||
"time 0.1.43",
|
"time 0.1.43",
|
||||||
"toml 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"toml",
|
||||||
"xi-rope 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xi-rope 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"xi-rpc",
|
"xi-rpc",
|
||||||
"xi-trace",
|
"xi-trace",
|
||||||
|
@ -5100,7 +5164,7 @@ dependencies = [
|
||||||
"bytecount 0.5.1",
|
"bytecount 0.5.1",
|
||||||
"memchr",
|
"memchr",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5112,7 +5176,7 @@ dependencies = [
|
||||||
"bytecount 0.6.2",
|
"bytecount 0.6.2",
|
||||||
"memchr",
|
"memchr",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5124,7 +5188,7 @@ checksum = "be5cc128a45e16fa5134e92496741994e9c181c2f3e7e5ff05bf04915a57990f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossbeam 0.7.3",
|
"crossbeam 0.7.3",
|
||||||
"log",
|
"log",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"xi-trace",
|
"xi-trace",
|
||||||
|
@ -5139,7 +5203,7 @@ dependencies = [
|
||||||
"lazy_static 1.4.0",
|
"lazy_static 1.4.0",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"serde",
|
"serde 1.0.130",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"time 0.1.43",
|
"time 0.1.43",
|
||||||
|
@ -5174,3 +5238,12 @@ name = "xmlwriter"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
|
checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "yaml-rust"
|
||||||
|
version = "0.4.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
|
||||||
|
dependencies = [
|
||||||
|
"linked-hash-map",
|
||||||
|
]
|
||||||
|
|
|
@ -5,6 +5,7 @@ authors = ["Dongdong Zhou <dzhou121@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
config = "0.11"
|
||||||
indexmap = "1.7.0"
|
indexmap = "1.7.0"
|
||||||
directories = "4.0.1"
|
directories = "4.0.1"
|
||||||
tinyfiledialogs = "3.8.3"
|
tinyfiledialogs = "3.8.3"
|
||||||
|
@ -39,7 +40,7 @@ fuzzy-matcher = "0.3.7"
|
||||||
uuid = { version = "0.7.4", features = ["v4"] }
|
uuid = { version = "0.7.4", features = ["v4"] }
|
||||||
lsp-types = { version = "0.89.2", features = ["proposed"] }
|
lsp-types = { version = "0.89.2", features = ["proposed"] }
|
||||||
druid = { git = "https://github.com/lapce/druid", features = ["svg", "im"] }
|
druid = { git = "https://github.com/lapce/druid", features = ["svg", "im"] }
|
||||||
toml = { git = "https://github.com/lapce/toml-rs" }
|
toml = { version = "0.5.8", features = ["preserve_order"] }
|
||||||
lapce-proxy = { path = "../proxy" }
|
lapce-proxy = { path = "../proxy" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|
|
@ -306,7 +306,7 @@ pub enum LapceUICommand {
|
||||||
location: EditorLocationNew,
|
location: EditorLocationNew,
|
||||||
},
|
},
|
||||||
SetWorkspace(LapceWorkspace),
|
SetWorkspace(LapceWorkspace),
|
||||||
SetTheme(String),
|
SetTheme(String, bool),
|
||||||
OpenFile(PathBuf),
|
OpenFile(PathBuf),
|
||||||
CancelCompletion(usize),
|
CancelCompletion(usize),
|
||||||
ResolveCompletion(BufferId, u64, usize, CompletionItem),
|
ResolveCompletion(BufferId, u64, usize, CompletionItem),
|
||||||
|
|
|
@ -83,37 +83,27 @@ pub struct Config {
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
pub fn load(workspace: Option<LapceWorkspace>) -> Result<Self> {
|
pub fn load(workspace: Option<LapceWorkspace>) -> Result<Self> {
|
||||||
let mut settings_string = default_settings.to_string();
|
let mut settings = config::Config::default().with_merged(
|
||||||
let mut files = vec![];
|
config::File::from_str(default_settings, config::FileFormat::Toml),
|
||||||
|
)?;
|
||||||
|
|
||||||
if let Some(proj_dirs) = ProjectDirs::from("", "", "Lapce") {
|
if let Some(proj_dirs) = ProjectDirs::from("", "", "Lapce") {
|
||||||
let path = proj_dirs.config_dir().join("settings.toml");
|
let path = proj_dirs.config_dir().join("settings.toml");
|
||||||
files.push(path);
|
settings.merge(config::File::from(path.as_path()).required(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(workspace) = workspace {
|
if let Some(workspace) = workspace {
|
||||||
match workspace.kind {
|
match workspace.kind {
|
||||||
crate::state::LapceWorkspaceType::Local => {
|
crate::state::LapceWorkspaceType::Local => {
|
||||||
let path = workspace.path.join("./.lapce/settings.toml");
|
let path = workspace.path.join("./.lapce/settings.toml");
|
||||||
files.push(path);
|
settings
|
||||||
|
.merge(config::File::from(path.as_path()).required(false));
|
||||||
}
|
}
|
||||||
crate::state::LapceWorkspaceType::RemoteSSH(_, _) => {}
|
crate::state::LapceWorkspaceType::RemoteSSH(_, _) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for f in files {
|
|
||||||
if let Ok(content) = std::fs::read_to_string(f) {
|
|
||||||
if content != "" {
|
|
||||||
let result: Result<toml::Value, toml::de::Error> =
|
|
||||||
toml::from_str(&content);
|
|
||||||
if result.is_ok() {
|
|
||||||
settings_string += &content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let config: toml::Value = toml::from_str(&settings_string)?;
|
let mut config: Config = settings.try_into()?;
|
||||||
let mut config: Config = config.try_into()?;
|
|
||||||
|
|
||||||
config.theme = get_theme(default_light_theme)?;
|
config.theme = get_theme(default_light_theme)?;
|
||||||
|
|
||||||
|
@ -125,6 +115,47 @@ pub fn load(workspace: Option<LapceWorkspace>) -> Result<Self> {
|
||||||
Ok(config)
|
Ok(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn settings_file() -> Option<PathBuf> {
|
||||||
|
ProjectDirs::from("", "", "Lapce")
|
||||||
|
.map(|d| d.config_dir().join("settings.toml"))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn update_file(key: &str, value: &str) -> Option<()> {
|
||||||
|
let path = Config::settings_file()?;
|
||||||
|
let content = std::fs::read(&path).ok()?;
|
||||||
|
let mut toml_value: toml::Value = toml::from_slice(&content)
|
||||||
|
.unwrap_or(toml::Value::Table(toml::value::Table::new()));
|
||||||
|
|
||||||
|
let mut table = toml_value.as_table_mut()?;
|
||||||
|
let parts: Vec<&str> = key.split(".").collect();
|
||||||
|
let n = parts.len();
|
||||||
|
for (i, key) in parts.into_iter().enumerate() {
|
||||||
|
if i == n - 1 {
|
||||||
|
table
|
||||||
|
.insert(key.to_string(), toml::Value::String(value.to_string()));
|
||||||
|
} else {
|
||||||
|
if !table.contains_key(key) {
|
||||||
|
table.insert(
|
||||||
|
key.to_string(),
|
||||||
|
toml::Value::Table(toml::value::Table::new()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
table = table.get_mut(key)?.as_table_mut()?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::fs::write(&path, toml::to_string(&toml_value).ok()?.as_bytes()).ok()?;
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_theme(&mut self, theme: &str, preview: bool) -> Option<()> {
|
||||||
|
self.lapce.color_theme = theme.to_string();
|
||||||
|
if !preview {
|
||||||
|
Config::update_file("lapce.color-theme", theme)?;
|
||||||
|
}
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_color_unchecked(&self, name: &str) -> &Color {
|
pub fn get_color_unchecked(&self, name: &str) -> &Color {
|
||||||
let theme = self
|
let theme = self
|
||||||
.themes
|
.themes
|
||||||
|
|
|
@ -185,7 +185,7 @@ fn select(&self, ctx: &mut EventCtx, preview: bool) -> Option<PaletteType> {
|
||||||
PaletteItemContent::Theme(theme) => {
|
PaletteItemContent::Theme(theme) => {
|
||||||
ctx.submit_command(Command::new(
|
ctx.submit_command(Command::new(
|
||||||
LAPCE_UI_COMMAND,
|
LAPCE_UI_COMMAND,
|
||||||
LapceUICommand::SetTheme(theme.to_string()),
|
LapceUICommand::SetTheme(theme.to_string(), preview),
|
||||||
Target::Auto,
|
Target::Auto,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -197,20 +197,6 @@ fn select(&self, ctx: &mut EventCtx, preview: bool) -> Option<PaletteType> {
|
||||||
Target::Auto,
|
Target::Auto,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
// LapceCommand::ChangeTheme => {
|
|
||||||
// if !preview {
|
|
||||||
// return Some(PaletteType::Theme);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// _ => {
|
|
||||||
// if !preview {
|
|
||||||
// ctx.submit_command(Command::new(
|
|
||||||
// LAPCE_NEW_COMMAND,
|
|
||||||
// command.clone(),
|
|
||||||
// Target::Auto,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
|
|
|
@ -392,9 +392,9 @@ fn event(
|
||||||
}
|
}
|
||||||
ctx.set_handled();
|
ctx.set_handled();
|
||||||
}
|
}
|
||||||
LapceUICommand::SetTheme(theme) => {
|
LapceUICommand::SetTheme(theme, preview) => {
|
||||||
let config = Arc::make_mut(&mut data.config);
|
let config = Arc::make_mut(&mut data.config);
|
||||||
config.lapce.color_theme = theme.to_string();
|
config.set_theme(theme, *preview);
|
||||||
ctx.set_handled();
|
ctx.set_handled();
|
||||||
}
|
}
|
||||||
LapceUICommand::UpdateBufferLineChanges(
|
LapceUICommand::UpdateBufferLineChanges(
|
||||||
|
|
Loading…
Reference in New Issue