简体   繁体   English

如何在摩纳哥编辑器中设置行尾

[英]How to set end of line in monaco-editor

Default is CRLF. 默认值为CRLF。 I want to change it to LF as i am dealing with BASH scripts. 我要将其更改为LF,因为我正在处理BASH脚本。 Please help. 请帮忙。

I have gone through the docs but could not find any solution or example. 我已经阅读了文档,但找不到任何解决方案或示例。

//https://github.com/Microsoft/vscode/blob/013501950e78b9dde5c2e6ec3f2ddfb9201156b7/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts#L30
code = code.replace(/\r\n/g, "\n");

My solution 我的解决方案

Have you tried setEOL() ? 您是否尝试过setEOL()? I'm also facing the same issue but I've used ITextModel interface so can't used setEOL. 我也面临同样的问题,但是我使用了ITextModel接口,所以不能使用setEOL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM