ReadOnlyCodeFolding
Defined in: extensions/folding/index.ts:22
Extends
Section titled “Extends”Properties
Section titled “Properties”fullCode
Section titled “fullCode”
readonlyfullCode:string
Defined in: extensions/folding/index.ts:24
The code in the editor with no ranges collapsed.
Methods
Section titled “Methods”toggleFold()
Section titled “toggleFold()”toggleFold(
lineNumber,force?):boolean
Defined in: extensions/folding/index.ts:35
Toggles whether a range is folded. Does not cause a rerender so it’s possible to toggle multiple folds simultaneously.
Parameters
Section titled “Parameters”lineNumber
Section titled “lineNumber”number
The line number of the fold.
force?
Section titled “force?”boolean
If set to true, the range will only be folded.
If false, the range will only be unfolded.
If undefined, it will be toggled.
Returns
Section titled “Returns”boolean
A boolean indicating whether or not a fold was toggled which means calling updateFolds in the near future is necessary.
update()
Section titled “update()”update(
editor,options):any
Defined in: types.ts:101
Function called when the extension is added or the options of the editor change.
Parameters
Section titled “Parameters”editor
Section titled “editor”PrismEditor<{ }>
options
Section titled “options”EditorOptions<{ }> & Omit<{ }, keyof EditorOptions<{ }>>
Returns
Section titled “Returns”any
Inherited from
Section titled “Inherited from”updateFolds()
Section titled “updateFolds()”updateFolds():
void
Defined in: extensions/folding/index.ts:37
Call this after the toggleFold method to rerender the editor.
Returns
Section titled “Returns”void