MCPcopy Index your code
hub / github.com/witheve/Eve / format

Method format

src/ide.ts:1265–1283  ·  view source on GitHub ↗
(source:{type:string, info?:string, level?: number, listData?: {type:"ordered"|"bullet", start?: number}}, refocus = false)

Source from the content-addressed store, hash-verified

1263 }
1264
1265 format(source:{type:string, info?:string, level?: number, listData?: {type:"ordered"|"bullet", start?: number}}, refocus = false) {
1266 let SpanClass:(typeof Span) = spanTypes[source.type] || spanTypes["default"];
1267
1268 let style = SpanClass.style();
1269 if(style === "inline") {
1270 this.formatInline(source);
1271
1272 } else if(style === "line") {
1273 this.formatLine(source);
1274
1275 } else if(style === "block") {
1276 this.formatBlock(source);
1277 }
1278
1279 if(refocus) this.cm.focus();
1280 this.newBlockBar.active = false;
1281
1282 this.queueUpdate();
1283 }
1284
1285 formatInline(source:{type:string}) {
1286 this.finalizeLastHistoryEntry();

Callers 3

EditorClass · 0.95
formatBarFunction · 0.80
newBlockBarFunction · 0.80

Calls 5

formatInlineMethod · 0.95
formatLineMethod · 0.95
formatBlockMethod · 0.95
styleMethod · 0.80
focusMethod · 0.80

Tested by

no test coverage detected