修复合并编辑时的代码问题
This commit is contained in:
@@ -361,7 +361,6 @@ export function BranchDropdown({
|
||||
// Remote has new commits — auto-pull then retry push
|
||||
updateTask(taskId, {
|
||||
status: "running",
|
||||
label: t("tasks.pullCode"),
|
||||
})
|
||||
try {
|
||||
const pullResult = await gitPull(folderPath)
|
||||
@@ -371,7 +370,7 @@ export function BranchDropdown({
|
||||
setConflictInfo(pullResult.conflict)
|
||||
} else {
|
||||
// Pull succeeded, retry push
|
||||
updateTask(taskId, { status: "running", label })
|
||||
updateTask(taskId, { status: "running" })
|
||||
const pushResult = await gitPush(folderPath)
|
||||
updateTask(taskId, { status: "completed" })
|
||||
onBranchChange()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
||||
import dynamic from "next/dynamic"
|
||||
import type { OnMount } from "@monaco-editor/react"
|
||||
import type { editor as MonacoEditorNs } from "monaco-editor"
|
||||
import type { editor as MonacoEditorNs, IRange } from "monaco-editor"
|
||||
import { ArrowLeft, ArrowRight, CheckCheck } from "lucide-react"
|
||||
import { useTranslations } from "next-intl"
|
||||
import { defineMonacoThemes, useMonacoThemeSync } from "@/lib/monaco-themes"
|
||||
@@ -676,8 +676,6 @@ function ArrowGutter({
|
||||
title,
|
||||
}: ArrowGutterProps) {
|
||||
const editor = editorRef.current
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const _tick = scrollTick // read to establish dependency
|
||||
|
||||
const positioned = useMemo(() => {
|
||||
if (!editor) return []
|
||||
@@ -729,7 +727,7 @@ function hunkToEditorRange(
|
||||
hunk: DiffHunk,
|
||||
allHunks: DiffHunk[],
|
||||
totalLines: number
|
||||
): MonacoEditorNs.IRange | null {
|
||||
): IRange | null {
|
||||
let offset = 0
|
||||
for (const h of allHunks) {
|
||||
if (h.baseStart >= hunk.baseStart) break
|
||||
|
||||
Reference in New Issue
Block a user