소스 검색

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();
       }