瀏覽代碼

133069 take changes of curPosAfterReplacing

soumaeda 2 年之前
父節點
當前提交
d85d088b9a
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      packages/editor/src/components/CodeMirrorEditor/Toolbar/TextFormatTools.tsx

+ 1 - 3
packages/editor/src/components/CodeMirrorEditor/Toolbar/TextFormatTools.tsx

@@ -53,9 +53,7 @@ export const TextFormatTools = (props: TextFormatToolsType): JSX.Element => {
 
       if (insertText) {
         view?.dispatch(insertText);
-        if (cursorPos) {
-          curPosAfterReplacing = cursorPos + prefix.length;
-        }
+        curPosAfterReplacing = cursorPos + prefix.length;
         view?.dispatch({ selection: { anchor: curPosAfterReplacing } });
         view?.focus();
       }