Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(docs): reserve the first remove text run (#3225)
Ran Luo01fdccad608c
diff --git a/packages/core/src/docs/data-model/text-x/apply-utils/common.ts b/packages/core/src/docs/data-model/text-x/apply-utils/common.tsindex 2633a2b438..07b6c9db05 100644--- a/packages/core/src/docs/data-model/text-x/apply-utils/common.ts+++ b/packages/core/src/docs/data-model/text-x/apply-utils/common.ts@@ -548,7 +548,13 @@ export function deleteTextRuns(body: IDocumentBody, textLength: number, currentIst: st - startIndex,ed: ed - startIndex,});- continue;++ // https://github.com/dream-num/univer-pro/issues/2044.+ if (startIndex === st) {+ textRun.ed = st;+ } else {+ continue;+ }} else if (st <= startIndex && ed >= endIndex) {/*** If the selection range is smaller than the current textRun,