如何重新包裝一段文字或長評論以適合80列?VS代碼:重新包裝文本或評論塊
我不希望它只是呈現自動換行(這是很容易與編輯取得 - >切換自動換行或設置"editor.wordWrap": "on"
),但我想它真正插入硬換行符。這個功能在一些編輯器中被稱爲「填充段落」。
例如:
// This is a very long comment. I would like for this comment to occupy multiple lines rather than a single line, so that it is easy to read for other people.
現在我想按任意鍵,得到:
// This is a very long comment. I would like for this comment to occupy
// multiple lines rather than a single line, so that it is easy to read for
// other people.
尋找一個可以作爲插件運行的JavaScript解決方案嗎?它是否必須是語言敏感的,比如'#'vs'//'? – tadman
@tadman您可以使用內置的類或標識來標識註釋,因爲它的所有html和css。 – BladeMight
@BladeMight是的,但是評論分隔符的大小影響了包裝,就像任何可能的縮進一樣。這表面上很簡單,但可能被證明有點令人討厭,無法完全正確。一個有趣的挑戰。 – tadman