Word Wrap for Text Editors

Hi All,

I have a requirement to toggle the wordwrap for only the selected/opened editors in a custom monaco editor view.

I am trying to set the word wrap using the this.preferenceService.set(‘editor.wordWrap’, … command.
But the problem is it set the word wrap for all the text based editors.

How can I set the word wrap for the single MonacoEditor Instance.

Thanks,
Abhishek

@chakraborty-slx thank you for the discussion.

Given you have an instance of MonacoEditor, you can call updateOptions to update the instance of editor’s options including wordWrap.

For example:

const editor = (editorWidget as MonacoEditor).getControl();
editor.updateOptions({ wordWrap: 'on' }); 
1 Like

Super thanks @vince-fugnitto

1 Like