Skip to content

Commit dced929

Browse files
committed
refactor: improve formatting and consistency in TOML generation and filtering logic
1 parent 6608288 commit dced929

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/pipeline/toml_filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ pub fn try_repair_file(path: &Path) -> Result<bool> {
324324
if repaired.contains("match_command = \".*\"") {
325325
repaired = repaired.replace(
326326
"match_command = \".*\"",
327-
"# match_command = \".*\" # [OMNI: disabled because it intercepts all commands]"
327+
"# match_command = \".*\" # [OMNI: disabled because it intercepts all commands]",
328328
);
329329
changed = true;
330330
}

src/session/learn.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ pub fn generate_toml(
9898
let cmd_base = cmd.split_whitespace().next().unwrap_or(cmd);
9999
// Ensure we don't accidentally match everything if cmd_base is empty or just special chars
100100
if !cmd_base.is_empty() && cmd_base != "." && cmd_base != "*" {
101-
toml.push_str(&format!("match_command = \"^{}.*\"\n", regex::escape(cmd_base)));
101+
toml.push_str(&format!(
102+
"match_command = \"^{}.*\"\n",
103+
regex::escape(cmd_base)
104+
));
102105
}
103106
} else {
104107
// Omitting match_command since it's now optional in the parser.

0 commit comments

Comments
 (0)