Browse Source

fix: correct pluralization of match count in grep and glob tools (#11565)

adamjhf 3 weeks ago
parent
commit
c3faeae9d0
1 changed files with 6 additions and 2 deletions
  1. 6 2
      packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

+ 6 - 2
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

@@ -1707,7 +1707,9 @@ function Glob(props: ToolProps<typeof GlobTool>) {
   return (
   return (
     <InlineTool icon="✱" pending="Finding files..." complete={props.input.pattern} part={props.part}>
     <InlineTool icon="✱" pending="Finding files..." complete={props.input.pattern} part={props.part}>
       Glob "{props.input.pattern}" <Show when={props.input.path}>in {normalizePath(props.input.path)} </Show>
       Glob "{props.input.pattern}" <Show when={props.input.path}>in {normalizePath(props.input.path)} </Show>
-      <Show when={props.metadata.count}>({props.metadata.count} matches)</Show>
+      <Show when={props.metadata.count}>
+        ({props.metadata.count} {props.metadata.count === 1 ? "match" : "matches"})
+      </Show>
     </InlineTool>
     </InlineTool>
   )
   )
 }
 }
@@ -1743,7 +1745,9 @@ function Grep(props: ToolProps<typeof GrepTool>) {
   return (
   return (
     <InlineTool icon="✱" pending="Searching content..." complete={props.input.pattern} part={props.part}>
     <InlineTool icon="✱" pending="Searching content..." complete={props.input.pattern} part={props.part}>
       Grep "{props.input.pattern}" <Show when={props.input.path}>in {normalizePath(props.input.path)} </Show>
       Grep "{props.input.pattern}" <Show when={props.input.path}>in {normalizePath(props.input.path)} </Show>
-      <Show when={props.metadata.matches}>({props.metadata.matches} matches)</Show>
+      <Show when={props.metadata.matches}>
+        ({props.metadata.matches} {props.metadata.matches === 1 ? "match" : "matches"})
+      </Show>
     </InlineTool>
     </InlineTool>
   )
   )
 }
 }