Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
@codebrainz I've opened a pull request # to address this issue. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-926929295
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
I have not. I'll update here if I do. If anyone wants to work on it, ping me if you need any assistance. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-825992953
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
I just wanted to ask if you could make any progress in this topic... (sorry if I am too impatient) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-825906379
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
After a little more research I think it might be possible to do it fully within JS by loading the scroll position from the browser's localStorage (or maybe just sessionStorage) when the DOM is finished loading and saving it before the page is unloaded. If I can get that working, it should do the trick for both Webkit1 and Webkit2 and allow to remove some code from the plugin. Basic theoretical untested code: ```js document.addEventListener('DOMContentLoaded', () => { const pos = localStorage.getItem('mdScrollPos'); if (pos) window.scrollTo(pos.x, pos.y); }); window.onbeforeunload = () => { localStorage.setItem('mdScrollPos', { x: window.scrollX, y: window.scrollY, }); }; ``` To make it have different scroll positions saved per file rather than one global scroll position for all files will require to pass the filename through the template to JS so it can keep track of which scroll position to load/save. It might also require a bit of JS code to prune/vacuum the localStorage to get rid of scroll positions older than a certain date and/or above a certain number, but that might be overkill. Next time I'm working on the plugin I'll try and see if it works. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-776559476
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
Oh wow, thanks for the 'investigations' about that bug. I think I understand the problem here although I only do a bit programming in C/gcbasic for 8051/arduino microcontrollers and TCL/TK by myself **;-)** I can imagine that if it's possible to run JS in the webview, this would be a workaround. But hey, if it's too time consuming for you, I fully understand. Geany is already a cool tool for coding a bit and write some markdown-text. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-776223165
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
After a little bit of reading/experimenting, I think this is probably caused by the Webkit2 no longer requiring a GtkScrolledWindow and handling scrolling on its own in a separate process. Whenever the existing scrollbar adjustments are read, the value is always zero, so the hack that was previously added for the old Webkit version no longer works. A possible workaround might be to run some javascript in the webview that can read the scroll position and pass it back up to the plugin's C code so it's able to save and then other JS to restore it. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-776151165
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
Hi again I'm at the company now. It is geany 1.34.1 that is working fine... Cant post it directly on github yet because I don't remember the pwd :( Best regards Simon Am 2021-02-05 02:26, schrieb Matthew Brush: > @Sci-Mon [1] do you mind reporting back with the version on Windows > whenever you're next on that computer? I swear this was fixed, but > maybe it got broken somehow in the intervening versions. > > -- > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub [2], or unsubscribe > [3]. > > Links: > -- > [1] https://github.com/Sci-Mon > [2] > https://github.com/geany/geany-plugins/issues/1055#issuecomment-773716894 > [3] > https://github.com/notifications/unsubscribe-auth/ASXNL5HE7LEYG7IICJPIQULS5NCNNANCNFSM4V3WCQPQ -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-773848390
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
@Sci-Mon do you mind reporting back with the version on Windows whenever you're next on that computer? I swear this was fixed, but maybe it got broken somehow in the intervening versions. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-773716894
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
Same scroll position bug here with geany 1.37.1 and geany plugins 1.37 compiled from sourcecode under Debian GNU/Linux 10 (buster) Not sure what version on windows at the moment (at the company) but it works well -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-773611708
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
I tried to fix this in d1a4dd15089551cd2eddcf9beb77ee9256f2d26f and I thought I remember @b4n helping with this too, but I can't seem to find that discussion. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/1055#issuecomment-757373611