Skip to content

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.

fix: copy formula (#1287)

Ran Luo476069239fc3
diff --git a/packages/docs/src/commands/commands/clipboard.command.ts b/packages/docs/src/commands/commands/clipboard.command.ts
index 1db519d281..7c06b34c58 100644
--- a/packages/docs/src/commands/commands/clipboard.command.ts
+++ b/packages/docs/src/commands/commands/clipboard.command.ts
@@ -45,7 +45,7 @@ export const DocPasteCommand: IMultiCommand = {
name: 'doc.command.paste',
type: CommandType.COMMAND,
multi: true,
- priority: 999,
+ priority: 999, // Need to bigger than SheetPasteCommand's priority.
preconditions: (contextService) =>
contextService.getContextValue(FOCUSING_DOC) || contextService.getContextValue(EDITOR_ACTIVATED),
handler: async () => true,
diff --git a/packages/sheets-ui/src/commands/commands/clipboard.command.ts b/packages/sheets-ui/src/commands/commands/clipboard.command.ts
index e1732ad2ee..655226131e 100644
--- a/packages/sheets-ui/src/commands/commands/clipboard.command.ts
+++ b/packages/sheets-ui/src/commands/commands/clipboard.command.ts
@@ -57,7 +57,7 @@ export const SheetPasteCommand: IMultiCommand = {
type: CommandType.COMMAND,
multi: true,
name: 'sheet.command.paste',
- priority: 1000,
+ priority: 998,
preconditions: whenSheetFocused,
handler: async (accessor: IAccessor, params: ISheetPasteParams) => {
const logService = accessor.get(ILogService);