rstudio / rstudio

RStudio is an integrated development environment (IDE) for R
https://posit.co/products/open-source/rstudio/
Other
4.68k stars 1.09k forks source link

Keyboard shortcuts (un-comment code, and undo) not operational, whereas menu functions are #12975

Closed aidanhorn closed 1 year ago

aidanhorn commented 1 year ago

System details

RStudio Edition : Desktop
RStudio Version : 2023.03.0+386 "Cherry Blossom"
Windows Edition : Windows 10 Home
OS Version      : 21H2 
OS Build        : 19044.2728
R Version       : 4.2.3 "Shortstop Beagle"

Steps to reproduce the problem

  1. Comment-out a block of code, using the keyboard shortcut (Ctrl + Shift + C).
  2. Un-comment it again, using the keyboard shortcut.

Describe the problem in detail

The code disappears, with a blank line in its place, when un-commenting with the keyboard shortcut. This problem does not occur when using the menu (Code > Comment/Uncomment Lines).

Pressing Ctrl + Z (undo), to bring the code back, only works for a split-second, before it gets deleted again. Using the Edit > Undo menu option does work.

To try resolve the problem:

I closed VS Code, restarted my computer, and had only R Studio and some meaningless programs open (such as Windows Explorer). The problem recurred. I had to exit the script without saving it (no work was lost for me).

Describe the behavior you expected

I expected the keyboard shortcuts (Ctrl + Shift + C) and (Ctrl + Z) to operate without deleting the code.

aidanhorn commented 1 year ago

I disabled AutoHotkey, and the issue went away.