MCPcopy Create free account
hub / github.com/cweijan/vscode-office / focusCodeBlock

Function focusCodeBlock

vditor/src/ts/codeBlock/codeMirrorManager.ts:1740–1749  ·  view source on GitHub ↗
(blockElement: HTMLElement, vditor: IVditor, collapseToStart = true)

Source from the content-addressed store, hash-verified

1738/** @deprecated use focusCodeMirror */
1739export const focusWysiwygCodeMirror = focusCodeMirror;
1740
1741export const focusCodeBlock = (blockElement: HTMLElement, vditor: IVditor, collapseToStart = true) => {
1742 if (isSpecialPreviewBlock(blockElement)) {
1743 return enterSpecialBlockEdit(vditor, blockElement);
1744 }
1745 if (!isCmCodeBlock(blockElement)) {
1746 return false;
1747 }
1748 focusCodeMirror(blockElement, collapseToStart, vditor);
1749 return true;
1750};
1751
1752export const updateCodeMirrorLanguage = (blockElement: HTMLElement, languageName: string) => {

Callers 4

showCodeFunction · 0.90
focusWysiwygCodeBlockFunction · 0.90
bindEventMethod · 0.90
focusCmBlockAtCursorFunction · 0.85

Calls 4

isSpecialPreviewBlockFunction · 0.85
enterSpecialBlockEditFunction · 0.85
isCmCodeBlockFunction · 0.85
focusCodeMirrorFunction · 0.85

Tested by

no test coverage detected