diff --git a/core/commands/util.ts b/core/commands/util.ts index 5a0ea32e4..3785b4f52 100644 --- a/core/commands/util.ts +++ b/core/commands/util.ts @@ -34,13 +34,18 @@ export function ctxItemToRifWithContents( ): RangeInFileWithContents { let startLine = 0; let endLine = 0; + let adjustLines = linesOffByOne ? 1 : 0; const nameSplit = item.name.split("("); if (nameSplit.length > 1) { const lines = nameSplit[1].split(")")[0].split("-"); - startLine = Number.parseInt(lines[0], 10) - (linesOffByOne ? 1 : 0); - endLine = Number.parseInt(lines[1], 10) - (linesOffByOne ? 1 : 0); + startLine = Number.parseInt(lines[0], 10); + if (startLine === 0) { + adjustLines = 0; // safety to make sure doesn't go negative + } + startLine -= adjustLines; + endLine = Number.parseInt(lines[1], 10) - adjustLines; } const rif: RangeInFileWithContents = { diff --git a/gui/src/components/mainInput/belowMainInput/ContextItemsPeek.tsx b/gui/src/components/mainInput/belowMainInput/ContextItemsPeek.tsx index eb63e0ee9..bb153f62a 100644 --- a/gui/src/components/mainInput/belowMainInput/ContextItemsPeek.tsx +++ b/gui/src/components/mainInput/belowMainInput/ContextItemsPeek.tsx @@ -42,7 +42,7 @@ function ContextItemsPeekItem({ contextItem }: ContextItemsPeekItemProps) { const isRangeInFile = name.includes(" (") && name.endsWith(")"); if (isRangeInFile) { - const rif = ctxItemToRifWithContents(contextItem); + const rif = ctxItemToRifWithContents(contextItem, true); ideMessenger.ide.showLines( rif.filepath, rif.range.start.line, diff --git a/gui/src/components/markdown/StepContainerPreToolbar/ApplyActions.tsx b/gui/src/components/markdown/StepContainerPreToolbar/ApplyActions.tsx index 0da1c5c7f..541abd78e 100644 --- a/gui/src/components/markdown/StepContainerPreToolbar/ApplyActions.tsx +++ b/gui/src/components/markdown/StepContainerPreToolbar/ApplyActions.tsx @@ -52,9 +52,11 @@ export default function ApplyActions(props: ApplyActionsProps) { case "streaming": return (
- + Applying changes - +
+ +
); diff --git a/gui/src/components/modelSelection/ModelSelect.tsx b/gui/src/components/modelSelection/ModelSelect.tsx index aa84f9f33..8191af54b 100644 --- a/gui/src/components/modelSelection/ModelSelect.tsx +++ b/gui/src/components/modelSelection/ModelSelect.tsx @@ -223,7 +223,7 @@ function ModelSelect() { ref={buttonRef} className="h-[18px] gap-1 border-none text-gray-400" > - + {modelSelectTitle(selectedChatModel) || "Select model"}