We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5566870 commit c6873f0Copy full SHA for c6873f0
Cargo.toml
@@ -4,7 +4,7 @@ path = "src/bin/lc.rs"
4
5
[package]
6
name = "leetcode-cli"
7
-version = "0.3.11"
+version = "0.3.12"
8
authors = ["clearloop <cdr.today@foxmail.com>"]
9
edition = "2021"
10
description = "Leet your code in command-line."
src/cfg.rs
@@ -132,6 +132,8 @@ pub struct Urls {
132
#[derive(Clone, Debug, Deserialize, Serialize)]
133
pub struct Code {
134
pub editor: String,
135
+ #[serde(rename(serialize = "editor-args", deserialize = "editor-args"))]
136
+ pub editor_args: Option<Vec<String>>,
137
pub lang: String,
138
pub pick: String,
139
pub submission: String,
src/cmds/edit.rs
@@ -121,8 +121,27 @@ impl Command for EditCommand {
121
}
122
123
124
+ // Get arguments of the editor
125
+ //
126
+ // for example:
127
128
+ // ```toml
129
+ // [code]
130
+ // editor = "emacsclient"
131
+ // editor-args = [ "-n", "-s", "doom" ]
+ // ```
+ // ```rust
+ // Command::new("emacsclient").args(&[ "-n", "-s", "doom", "<problem>" ])
+ let mut args: Vec<String> = Default::default();
+ if let Some(editor_args) = conf.code.editor_args {
+ args.extend_from_slice(&editor_args);
140
+ }
141
+
142
+ args.push(path);
143
std::process::Command::new(conf.code.editor)
- .arg(path)
144
+ .args(args)
145
.status()?;
146
Ok(())
147
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments