Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditonally wrap line in Monaco Editor

I want to be able to wrap a line conditionally.

if it matches a regex pattern then it doesn't wrap.

What is the best way to implement this?

like image 351
Marc Frame Avatar asked Oct 29 '25 15:10

Marc Frame


1 Answers

I believe you can call editor.updateOptions({ wordWrap: "off" }) to switch between the states after the editor has been created. Depending on your code you could call this function when your condition is true or false

like image 90
Niklas Avatar answered Nov 01 '25 12:11

Niklas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!