File tree Expand file tree Collapse file tree 2 files changed +132
-73
lines changed Expand file tree Collapse file tree 2 files changed +132
-73
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,13 @@ let jar = CodeJar(editor, highlight)
53
53
Third argument to ` CodeJar ` is options:
54
54
- ` tab: string ` replaces "tabs" with given string. Default: ` \t ` .
55
55
- Note: use css rule ` tab-size ` to customize size.
56
- - ` indentOn: RegExp ` allows auto indent rule to be customized. Default ` {$ `
56
+ - ` indentOn: RegExp ` allows auto indent rule to be customized. Default ` {$ ` .
57
57
- Auto-tab if the text before cursor match the given regex while pressing Enter.
58
- - ` spellcheck: boolean ` enables spellchecking on the editor. Default ` false `
59
- - ` addClosing: boolean ` automatically adds closing brackets, quotes. Default ` true `
58
+ - ` spellcheck: boolean ` enables spellchecking on the editor. Default ` false ` .
59
+ - ` catchTab: boolean ` catches Tab keypress events and replaces it with ` tab ` string. Default: ` true ` .
60
+ - ` preserveIdent: boolean ` keeps indent levels on new line. Default ` true ` .
61
+ - ` addClosing: boolean ` automatically adds closing brackets, quotes. Default ` true ` .
62
+ - ` history ` records history. Default ` true ` .
60
63
61
64
62
65
``` js
@@ -122,6 +125,26 @@ Return current code.
122
125
let code = jar .toString ()
123
126
```
124
127
128
+ #### ` save(): string `
129
+
130
+ Saves current cursor position.
131
+
132
+ ``` js
133
+ let pos = jar .save ()
134
+ ```
135
+
136
+ #### ` restore(pos: Position) `
137
+
138
+ Restore cursor position.
139
+
140
+ ``` js
141
+ jar .restore (pos)
142
+ ```
143
+
144
+ #### ` recordHistory() `
145
+
146
+ Saves current editor state to history.
147
+
125
148
#### ` destroy() `
126
149
127
150
Removes event listeners from editor.
You can’t perform that action at this time.
0 commit comments