user387184
user387184

Reputation: 11053

deleting collapsed code section in Eclipse

Collapsing code sections is nice. But everytime I select the collapsed part in the editor and cut/delete it the selection expands and I have to find the start/end manually in the expanded code.

Is there an easier way?

Many thanks!

Upvotes: 1

Views: 588

Answers (2)

jeff
jeff

Reputation: 3732

Using Neon

  1. Collapse the code
  2. Double click the collapsed code
  3. Hit ctrl-x or the Delete key.

Hitting Backspace or the Enter key still just expands the collapsed code

Upvotes: 0

Hauke Ingmar Schmidt
Hauke Ingmar Schmidt

Reputation: 11607

When your cursor is inside the element you can use Select Enclosing Element Shift+Alt+Up. You may need to press it a few times, depending how many levels of enclosing elements there are (blocks like loops).

You may use a desktop environment that thinks it is a good idea to define a few hundred shortcuts that you will never use but that override all your application shortcuts (Ubuntu Unity). In this case you may need to change your desktop environment (by far the most painless way to solve this problem).

Upvotes: 2

Related Questions