You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`content` is the preset content when opening the editor. If you don’t want to preset any content, you can leave this parameter blank. When the user clicks Close or actively calls the `textEditorClose()` method, the `onClose` callback will be triggered, and the parameter `value` is the text content in the current editor.
381
+
`content` is the preset content when opening the editor. If you don’t want to preset any content, you can leave this
382
+
parameter blank. When the user clicks Close or actively calls the `textEditorClose()` method, the `onClose` callback
383
+
will be triggered, and the parameter `value` is the text content in the current editor,
384
+
`options` is the parameter passed in when closing.
381
385
382
386
For more information on how to use text editors, see [Text Editor](#TextEditor).
383
387
@@ -386,7 +390,9 @@ For more information on how to use text editors, see [Text Editor](#TextEditor).
386
390
This method is used to close the currently opened text editor. After calling, it will trigger the `onClose` callback when it is opened.
387
391
388
392
```js
389
-
TerminalApi.textEditorClose('my-terminal')
393
+
TerminalApi.textEditorClose('my-terminal', true)
394
+
395
+
TerminalApi.textEditorClose('my-terminal', false)
390
396
```
391
397
392
398
## Message
@@ -798,8 +804,8 @@ When you want to edit multi-line text, you can use the API: `textEditorOpen()`,
798
804
```js
799
805
TerminalApi.textEditorOpen('my-terminal', {
800
806
content:'Please edit this file',
801
-
onClose: (value) => {
802
-
console.log("User edit completed, text result:", value)
807
+
onClose: (value, options) => {
808
+
console.log("User edit completed, text result:", value, "options:", options)
803
809
}
804
810
})
805
811
```
@@ -827,7 +833,8 @@ The plugin provides an `onKeydown` event, which is the best way for you to contr
0 commit comments