开发者

How do you search for the top bracket in an IF statement?

开发者 https://www.devze.com 2023-01-08 09:57 出处:网络
Ok, i have to fix somebody else\'s code, and basically on line 892 there\'s an ELSE/IF statement, but i can\'t find the original IF statement! The inconsistent nesting is making this extremely hard.

Ok, i have to fix somebody else's code, and basically on line 892 there's an ELSE/IF statement, but i can't find the original IF statement! The inconsistent nesting is making this extremely hard.

I've trailed up the cod开发者_Go百科e to see if i can find the original but i can't. Does anybody have any ideas how i can search for the originating IF statement besides scrolling with the mouse?

By the way, i'm using Eclipse. Thanks :)


If you're using the CDT, Ctrl-Shift-P is "Go to matching bracket". It may also exist in vanilla Eclipse, PyDev, etc...

if(...) { ... } else { ... }

click on the bolded brace above and Ctrl-Shift-P your way to success!


Why don't you press ctrl-f to format the code and then you should be able to line up the if/else statement. Also you could turn code folding on and close each set of if/else statements until you find it.

0

精彩评论

暂无评论...
验证码 换一张
取 消