简体   繁体   中英

Eclipse jump to end of scope/method with keyboard shortcut

Is is possible to jump to the end of a scope such as a method, loop, if statement, switch statement...etc with a keyboard shortcut?

I know this is possible with control shift p , but it only goes to the beginning of the closing curly brace, and not over it. For example:

This is my code.

if (x < 10) {
    System.out.println("X is less than ten.");| //my cursor is '|'
}

When I press control+shift+P my cursor jumps here:

if (x < 10) {
    System.out.println("X is less than ten.");
|}   //my cursor is '|'

But I want it to go here.

if (x < 10) {
    System.out.println("X is less than ten.");
}|   //my cursor is '|'

Is this possible?

Your keys seemed to be mapped differently than my keys, but look in the Preferences (General --> Keys) to see exactly what commands are available for your version of Eclipse and OS. I think the closest command to what you're looking for is Run to Line (where you have to point to the line with the closing curly bracket).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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