How to turn off a weird "box" cursor and selection behavior in Netbeans?

I have some kind of weird behavior in Netbeans. I guess I accidentally entered some key combination which messed up the cursor and selection behavior. In the image you'll see what I mean: normally, if you select text across multiple lines, you'll see the behavior on the right screenshot.

But I have the behavior on the left screenshot. Also, trying to insert text at a certain position with Shift, inserts it some positions to the right (= not where the cursor is). Additionally, when the cursor blinks, it appears dashed.

Netbeans comparison

The fact that the selection in the left screenshot is drawn nicely doesn't make me think of a bug, but rather of a feature. I can't seem to find the key combination to turn it off again.

So my question is, what is this feature? Why does it exist and with what key combination did I turn it on?

31296 次浏览

One possibility is you have the Rectangular Selection plugin installed.

However, the more likely candidate is the rectangular selection feature in the editor core. Find the button on your edit toolbar, and toggle it off. As per helpful comments below, this can accidentally be switched on (and toggled back off again) using:

  • On Windows and Linux: Ctrl + Shift + R
  • On Mac: Shift + Meta + R
  • On Mac, if the above does not work: some folks have reported that Shift + Command + R worked for them

This key combination (Ctrl+Shift+R) is used to open types etc. in Eclipse, so when switching to Netbeans many people will get stuck with this.

You can use it to write multiple lines with the same content as sublime text

See this examples:

https://blogs.oracle.com/netbeansphp/entry/rectangular_selection