簡體   English   中英

在 Visual Studio Code 中復制和粘貼折疊的代碼

[英]Copy & Paste folded Code in Visual Studio Code

當我復制折疊代碼時,它只是粘貼開始行(可見)。

例如,如果我在折疊時復制此代碼:

Expanded(
  flex: 2,    
  child: Image(
    image: AssetImage('images/dice1.png'),
  ),
),

它只會粘貼起始代碼:

Expanded(

您必須 select 也是折疊范圍的末尾才能成功復制所有折疊內容。

看到這個問題

一種解決方法是在 settings.json 中添加這一行:

"editor.foldingStrategy": "indentation"

這將使您可以看到結束范圍使您可以到達 select 並包括它。

在 Visual Studio Code 中,只需按 ( Ctrl + Shift + [ ) 折疊代碼和 ( Ctrl + Shift + Down ) 到選定代碼。
然后復制選定的代碼( Ctrl + c )。
在 Mac 中:
命令 = ctrl
選項 = alt

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM