Hirse / brackets-outline-list

Extension for Brackets and Phoenix to display a list of the functions or definitions in the currently opened document.
MIT License
79 stars 30 forks source link

[REQ] Remember scroll height when panel is on the right side #106

Closed schroef closed 5 years ago

schroef commented 5 years ago

v1.4.1 osx 10.11.6

I would like to know if it's possible to remember the scroll position when the panel is on the right side. I really like this option and that its closing by itself. The downside is that one needs to tons of scroll because each time the scroll is reset to zero or top.

Could there perhaps be added some variable which check the scroll position so it can be called upon when panel opens again?

See attached, this is what i mean, each time it closes i need to find the prior position. Which is very tedious remember-scroll-position

Hirse commented 5 years ago

That seems like a reasonable change. Thanks for the good video.

If I remember correctly, @pelatx wrote the autohide feature some time ago. Would you be interested to look into this? Otherwise, I'll have a look later.

pelatx commented 5 years ago

Yes @Hirse. I am interested.

schroef commented 5 years ago

Im glad you guys like it.

PS i got one more thing, but thats for @pelatx. Is it possible to add perhaps some sort of delay.

Now with the menu on the right side. When i try to scroll sometimes i hit the bar by accident. Than the menu pops open of course. But a delay will also have its downside of course, user need to wait and most people hate waiting :)

Custom works has a small half circle showing in the middle. Perhaps something like this? Perhaps i should have made a new post for this :)... The options is called half circle in sidebar

See attached popopen-hotzone

pelatx commented 5 years ago

I like the semicircle idea, but I'm not shure that works correctly on right side of the editor. Due the editor scroll bar.

Maybe a short delay can be fine. I could test both and let you know my impressions. But I want to know @Hirse's opinion about this before.

Hirse commented 5 years ago

@pelatx, I agree completely. I wouldn't mind adding another setting for the delay (we can argue about the default value 😉). I'd be very happy if you want to give it a try.

schroef commented 5 years ago

Okay sweet!

I just noticed the update, it works like a charm! This is so much easier to work with now, hope other users find this as handy.

Thanks for this quick release, really fast coding there!!!

schroef commented 5 years ago

Wow was this feature really that simple to add. I only see there is a var declared which essentially is always False. I dont see it being declared True. Seem almost to simple

pelatx commented 5 years ago

Yesterday I tried the semi circle and I was able to confirm that there is interference with the editor's scroll bar. I think it's not a good solution.

I'm going to write the delay to see how it works. @Hirse, how would you implement the option for delay? in the preferences menu with an input box directly there? With a modal dialog that opens from an option in the preferences menu?

@schroef, yes that has been a very simple solution. Only one variable that saves the scrolled pixels when the outline is going to hide. And then they are read when it's going to show up again.

Hirse commented 5 years ago

Thanks, @pelatx. I wouldn't expose the setting to the UI as it is not something a user would change a lot. We could possibly add it to the View-menu (next to the autohide option). We probably should add something to the repo Readme about the option(s) though.

pelatx commented 5 years ago

I agree with that. I had misinterpreted your previous comment and I understood that you just wanted to add it to the settings dropdown of the Outline.

I have an initial version and I'm going to raise a PR so you can try it. From here, if the feature should be included, we can continue from what you suggest.

Regarding the delay, I opted for 0.5 seconds, after trying a bit.