简体   繁体   English

Android Studio粘贴问题

[英]Android Studio paste issue

Whenever I try to paste some lines of code into a file in Android Studio it acts like this: 每当我尝试将一些代码行粘贴到Android Studio中的文件中时,它的行为如下:

  1. Copied lines overwrite existing lines below caret position. 复制的行覆盖插入位置下方的现有行。
  2. It pastes several times for a single command (I copy 7 lines and press Ctrl+V just once and it gives me 49 lines) 它为一个命令粘贴了几次(我复制7行并按Ctrl + V一次,它给我49行)

I don't know if this is some weird coding feature that I'm unaware of. 我不知道这是不是我不知道的一些奇怪的编码功能。

How can I turn this behavior off and make it work the ordinary way? 如何关闭此行为并使其以普通方式工作?

Update it's not a keyboard issue. 更新它不是键盘问题。 No problem in Visual Studio! 在Visual Studio中没问题!

In case someone else should face a similar issue in the future, mine was fixed after I marked and then unmarked Column Selection Mode (Alt+Shift+Insert). 如果其他人将来应该遇到类似的问题,我在标记后取消标记列选择模式(Alt + Shift + Insert)后修复了。

Still strange but it resolved the issue! 仍然很奇怪,但它解决了这个问题!

I have the same issue I fix by clear android studio cache 我有明确的android工作室缓存修复相同的问题

File ---> Invalidate Caches/Restart 文件--->使高速缓存/重新启动无效

在此输入图像描述

Another solution 另一种方法

instead using ctrl + v Use ctrl + Alt + Shift + V 而是使用ctrl + v使用ctrl + Alt + Shift + V.

Probable Reasons: 可能的原因:

  1. You are copying from somewhere where lines are hiding inside compact brackets 您正在从线条隐藏在紧凑括号内的某处复制
  2. Your keys/keyboard is gone might generating 7 times same signal for a command (7*7 = 49) 您的键/键盘消失可能会为命令生成7倍相同的信号(7 * 7 = 49)

Please check 请检查

在android studio 2.2或更高版本中按住Control键,然后拖动布局或小部件以复制

按键盘上的“插入”按钮(标有“ins”)

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

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