fdorg / flashdevelop

FlashDevelop is a free and open source code editor.
MIT License
824 stars 221 forks source link

Expand collapsed block when navigate to function definition #293

Open robinrodricks opened 10 years ago

robinrodricks commented 10 years ago

Suppose I'm debugging and I double click a function in the call stack, navigation fails if the function is inside a collapsed block. So usually I have to Expand All and double click again

To fix this can you do the following...

sci.GotoLine(line);
sci.EnsureVisible(line);

...in all the following places?

This would greatly improve navigation in files where you have regions, as you will not have to open regions by hand anymore.

elsassph commented 10 years ago

Ok could reproduce it.

robinrodricks commented 10 years ago

I need to code this in a plugin as well. Also created a post regarding this. (http://www.flashdevelop.org/community/viewtopic.php?f=4&t=11860&p=52065#p52065)

Can you please tell me how to detect if a line is visible? And also how to find the nearest parent block .. and then how to expand only a certain block, not all blocks... If its hard and you will do it later its ok, I'll wait.

elsassph commented 10 years ago

Scintilla should have some kind of "EnsureVisible(line)" method.

robinrodricks commented 10 years ago

BRILLIANT! EnsureVisible works exactly as needed. Its a one line fix. Here is my code:

 sci.GotoLine(line);
 sci.EnsureVisible(line); // it expands the PARENT block automatically, not just the single line
robinrodricks commented 10 years ago

Oops I closed the issue, forgetting that this is a FD bug too. I reopened it and you can close it when needed. Sorry! Try EnsureVisible, it should solve this bug in FD.

robinrodricks commented 10 years ago

I updated the issue comment to list the places this needs to be updated in. When you get time. Thanks.