API Editor - SentryXSI/Codiad GitHub Wiki
Editor Component for Codiad
Manage the lifecycle of Editor instances
-
Retrieve editor settings from localStorage
-
Create a new editor instance attached to given session
Parameters:
Parameter Type Details session EditSession Session to be used for new Editor instance -
Remove all Editor instances and clean up the DOM
-
Detach EditSession session from all Editor instances replacing
them with replacementSession
-
Convenience function to iterate over Editor instances
Parameters:
Parameter Type Details fn Function callback called with each member as an argument -
Get the currently active Editor instance
In a multi-pane setup this would correspond to the
editor pane user is currently working on.
-
Set an editor instance as active
Parameters:
Parameter Type Details i Editor -
Change the EditSession of Editor instance
Parameters:
Parameter Type Details session EditSession i Editor -
Select file mode by extension
Parameters:
Parameter Type Details e String File extension -
Set the editor mode
Parameters:
Parameter Type Details m TextMode mode i Editor Editor (Defaults to active editor) -
Set the editor theme
Parameters:
Parameter Type Details t String theme eg. twilight, cobalt etc. i Editor Editor instance (If omitted, Defaults to all editors) For a list of themes supported by Ace - refer :
https : //github.com/ajaxorg/ace/tree/master/lib/ace/theme
TODO : Provide support for custom themes
-
Set contents of the editor
Parameters:
Parameter Type Details c String content i Editor (Defaults to active editor) -
Set Font Size
Set the font for all Editor instances and remember
the value for Editor instances to be created in
future
Parameters:
Parameter Type Details s Number font size i Editor Editor instance (If omitted, Defaults to all editors) -
Enable/disable Highlighting of active line
Parameters:
Parameter Type Details h Boolean i Editor Editor instance ( If left out, setting is applied to all editors )
-
Show/Hide print margin indicator
Parameters:
Parameter Type Details p Number print margin column i Editor (If omitted, Defaults to all editors) -
Show/Hide indent guides
Parameters:
Parameter Type Details g Boolean i Editor (If omitted, Defaults to all editors) -
Enable/Disable Code Folding
Parameters:
Parameter Type Details f Boolean i Editor (If omitted, Defaults to all editors) -
Enable/Disable Line Wrapping
Parameters:
Parameter Type Details w Boolean i Editor (If omitted, Defaults to all editors) -
Get content from editor
Parameters:
Parameter Type Details i Editor (Defaults to active editor) -
Resize the editor - Trigger the editor to readjust its layout
esp if the container has been resized manually.
Parameters:
Parameter Type Details i Editor (Defaults to active editor) -
Mark the instance as changed (in the user interface)
upon change in the document content.
Parameters:
Parameter Type Details i Editor -
Get Selected Text
Parameters:
Parameter Type Details i Editor (Defaults to active editor) -
Insert text
Parameters:
Parameter Type Details val String Text to be inserted i Editor (Defaults to active editor) -
Move the cursor to a particular line
Parameters:
Parameter Type Details line Number Line number i Editor Editor instance -
Focus an editor
Parameters:
Parameter Type Details i Editor Editor instance (Defaults to current editor) -
Setup Cursor Tracking
Parameters:
Parameter Type Details i Editor (Defaults to active editor) -
Setup Key bindings
Parameters:
Parameter Type Details i Editor -
Present the Search (Find + Replace) dialog box
Parameters:
Parameter Type Details type String Optional, defaults to find. Provide 'replace' for replace dialog. -
Perform Search (Find + Replace) operation
Parameters:
Parameter Type Details action String find | replace | replaceAll i Editor Defaults to active Editor instance