diff --git a/docs/config/README.md b/docs/config/README.md index d2a8a14f..6b2e829a 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -1075,7 +1075,7 @@ that information will be shown too. | `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. | | `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | | `style` | `"bold yellow"` | The style for the module. | -| `format` | `"[\\($state( $progress_current/$progress_total)\\)]($style) "` | The format for the module. | +| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. | | `disabled` | `false` | Disables the `git_state` module. | ### Variables diff --git a/src/configs/git_state.rs b/src/configs/git_state.rs index f056f53e..a938f556 100644 --- a/src/configs/git_state.rs +++ b/src/configs/git_state.rs @@ -27,7 +27,7 @@ impl<'a> RootModuleConfig<'a> for GitStateConfig<'a> { am: "AM", am_or_rebase: "AM/REBASE", style: "bold yellow", - format: "[\\($state( $progress_current/$progress_total)\\)]($style) ", + format: "\\([$state( $progress_current/$progress_total)]($style)\\) ", disabled: false, } } diff --git a/src/modules/git_state.rs b/src/modules/git_state.rs index 40c9e9cd..18194ae6 100644 --- a/src/modules/git_state.rs +++ b/src/modules/git_state.rs @@ -190,7 +190,7 @@ mod tests { let actual = ModuleRenderer::new("git_state").path(path).collect(); - let expected = Some(format!("{} ", Color::Yellow.bold().paint("(REBASING 1/1)"))); + let expected = Some(format!("({}) ", Color::Yellow.bold().paint("REBASING 1/1"))); assert_eq!(expected, actual); repo_dir.close() @@ -205,7 +205,7 @@ mod tests { let actual = ModuleRenderer::new("git_state").path(path).collect(); - let expected = Some(format!("{} ", Color::Yellow.bold().paint("(MERGING)"))); + let expected = Some(format!("({}) ", Color::Yellow.bold().paint("MERGING"))); assert_eq!(expected, actual); repo_dir.close() @@ -221,8 +221,8 @@ mod tests { let actual = ModuleRenderer::new("git_state").path(path).collect(); let expected = Some(format!( - "{} ", - Color::Yellow.bold().paint("(CHERRY-PICKING)") + "({}) ", + Color::Yellow.bold().paint("CHERRY-PICKING") )); assert_eq!(expected, actual); @@ -238,7 +238,7 @@ mod tests { let actual = ModuleRenderer::new("git_state").path(path).collect(); - let expected = Some(format!("{} ", Color::Yellow.bold().paint("(BISECTING)"))); + let expected = Some(format!("({}) ", Color::Yellow.bold().paint("BISECTING"))); assert_eq!(expected, actual); repo_dir.close() @@ -253,7 +253,7 @@ mod tests { let actual = ModuleRenderer::new("git_state").path(path).collect(); - let expected = Some(format!("{} ", Color::Yellow.bold().paint("(REVERTING)"))); + let expected = Some(format!("({}) ", Color::Yellow.bold().paint("REVERTING"))); assert_eq!(expected, actual); repo_dir.close()