-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shortcut to make the editor invisible #4
Comments
I forgot to mention yesterday the jumping point, that in the moment where the editor is in off-mode, the sidebar should have the full width of the Geany window. So, maybe this is a better shortcut name: |
@xiota |
I recognized that the name The shortcut Just for information: These would be then my shortcuts for Geany Preview: |
@ralf3u Sorry for not responding sooner... This can be done with a Lua script, similar to hiding the menubar. I have added toggle-editor to xiota/geanylua-scripts. Some of the files are shared with toggle-menu, so you will have to open them to copy the new lines. Also, events/cleanup.lua from toggle-menu is changed to fix a minor issue. |
Wow! That's so cool! 1 2 3 4
At the moment this is not respected. So, now if I press F3 to let disappear the Sidebar (shortcut "Toggle Sidebar") and then F4 (shortcut "Toggle editor"), there is an empty Geany. I would expect only the preview. 5 |
Would a script that resizes the sidebar do what you want? You could set a list of percentages, like 30%, 70%, 100%. Then it would cycle through them. That might avoid the current problems with toggle-editor. |
I think that there is a misunderstanding. I just recognized that not all html-documents show a vertical line for a part of a second. It seems to be that some html-documents are shown sometimes with an artifact just for a part of a second, is it the vertical line or something else. Maybe it is because the used computer is slow. Down below is an example of html-code. In the moment where I press the shortcut "Toggle editor", I can see sometimes not only the green color in the middle, but also for a part of a second a green rectangle on the left side, specially when pressing fast many times the shortcut "Toggle editor". Do you see it too?
|
If I hold down the shortcut and let it run as fast as it can, I see green on the left (normally my sidebar is on the right). It's probably a GUI update/refresh that I can't do anything about. I just looked at the GeanyLua API. Unfortunately, I don't see anything that can be used to resize the sidebar. |
I didn't ask to resize the sidebar. The vertical line that appears just for a part of a second somewhere else in Geany, appears not in all html-documents, but only in some html-documents. And it seems to be that the GUI update/refresh is the cause that creates some artifacts for a part of a second, like the green color mentioned in your last comment. To 4 and 5: focus feature Would it be possible to add the two focus features a and b to the shortcut "Toggle editor"? |
I know you didn't ask for that, but doing so would have provided the feature you want (maximizing the sidebar) without the other problems.
I think so too. It is from GTK and out of my control. To fix it (in GTK) would probably require low level changes that would cause more problems. Since it's only momentary, it's better to leave it alone.
The toggle scripts could look for the state files of each other's toggle scripts. It makes the code complicated, and it's better not to if it isn't needed.
The GeanyLua API is limited, so it might not be possible. I'll check. |
That would be great. Maybe this link xiota/geany-tab-style#5 could help, because also at the beginning of the development of the shortcut "Toggle between the editor and preview", the content of the Preview-tab was not in focus. |
It might work now. Let me know.
auto-sidebar does not create a state file. Geany built-in toggle does not create a state file. I would need to make a toggle-sidebar script that saves a state file to make toggle-editor play nicely with it. I'll look at it later. |
Now when toggling, the tab-title of the Preview is in focus and then the tab-title of the editor is in focus. In the end the focus of the shortcut "Toggle editor" should work exactly like the focus of the shortcut "Toggle between the editor and preview", in the editor and in the preview. |
Lua doesn't have any way to focus on the contents of the tab. You can use the down key to move focus inside the tab. Or I can put it back the way before and not bother trying to move focus. |
What about to put the shortcut "Toggle editor" in the plugin Preview, like the shortcut "Toggle between the editor and preview"? |
The new toggle-editor-lua-scripts have four disadvantages when toggling:
Those four disadvantages do not occur in the old toggle-editor-lua-scripts. |
I've reverted the change. I'd rather not put this in the preview plugin. Trying to hiding gui elements and grab focus hasn't worked well in the past (eg, toggle focus between editor and sidebar). |
I don't understand. The shortcut "Toggle focus between the editor and sidebar" works absolutely perfect. There is not even one thing that does not work. There is no open issue about that. |
Maybe I'm mis-remembering. I thought there were problems with tab navigation or something. Maybe I'm confusing it with something else. GeanyLua references widgets by their name in the glade file. I don't think it's possible to access GTK widgets that are created at runtime, like the contents of specific tabs. There's another scripting plugin (peasy) that might be able to do it. I haven't tried writing any scripts for it yet. |
There was a problem with tab-browsing (xiota/geany-tab-style#6; in the comment it is called "issue 3"). It was fixed (xiota/geany-tab-style#6), then reappeared (xiota/geany-preview#11), and now just disappeared (xiota/geany-preview#11 (comment)). It was only visible when the Symbols-tab was part of the sidebar (xiota/geany-preview#11 (comment)), so it was just a very small issue.
Tomorrow I would like to open in Geany Preview a new issue about the shortcut "Toggle sidebar". Then the next day I would like to open again an issue, but this time about the shortcut "Toggle editor". If you don't like both reports, just delete them, and copy those parts of text that you think could be interesting, maybe to paste the parts here in this issue. |
Thank you so much for the shortcut "Toggle editor". It is a significant option, because now there's no need to switch to the browser to see the webpage in big, if one don't want to resize the sidebar with the mouse. |
It's quite interesting, because in the second comment of this issue I noted:
To that time, I didn't use a small display. I even didn't think to use a small display. But things have changed, and now I'm using a small display. Well, it is not really small, but the width is not so big. So, the shortcut to make the editor invisible is for me very interesting. The best would be if the shortcut works like this: |
With the I've updated the scripts to attempt to change focus at the same time editor/sidebar visibility is changed. I think before I tried to add some delay to work around some issue, but it never really worked and now no longer needed. |
That sounds so great!! |
it could be that sometimes one will see only the content of the preview
possible solution
in Preferences, in Keybindings: toggle editor on/off
The text was updated successfully, but these errors were encountered: