Skip to content
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

add the shortcut "Toggle between editor and sidebar" to the plugin #40

Closed
ralf3u opened this issue Jun 22, 2022 · 18 comments
Closed

add the shortcut "Toggle between editor and sidebar" to the plugin #40

ralf3u opened this issue Jun 22, 2022 · 18 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@ralf3u
Copy link

ralf3u commented Jun 22, 2022

reasons
Because of #20, editing a long HTML-document, the change will not directly appear in the Preview, it could be better that some users want to code in the only-one-view-modes, so only-editor-view or only-sidebar-view. For this situation, two shortcuts would be needed, "Toggle sidebar" #37 and "Toggle editor" #38 (that both don't exist at the moment inside the plugin). But one shortcut would be better. Two other situations where it could be also useful: 1) webpage that has a big width, and 2) because maybe one don't want to be distracted by the Preview while typing.

entering
It should start what was in focus just before pressing the shortcut, but only if the only-view is not already active. If the only-view is already active because for example the shortcut "Toggle editor" was pressed just before, then the counterpart should be shown (so, to stay in this example, if in the only-editor-view the shortcut "Toggle between editor and sidebar" is pressed, then after pressing the shortcut, the only-sidebar-view should appear). That means that the state file of the two shortcuts ("Toggle sidebar" and "Toggle editor") need to be checked first, if there are active, and if one of them is active, then the one should be de-activated.

leaving
The exit of the loop would be possible with the shortcuts "Toggle editor" or "Toggle sidebar".
Example:
If the only-sidebar-view is active, and if the shortcut "Toggle editor" is pressed, then "Toggle editor" need to be pressed 2x, to see editor and preview side-by-side.
If the only-sidebar-view is active, and if the shortcut "Toggle sidebar" is pressed, then editor and preview will appear side-by-side.
For the leaving-scenarios the state file of the two shortcuts "Toggle editor" and "Toggle sidebar" need to be extended, because they need to check first if "Toggle between editor and sidebar" is active. That means that a state file for the shortcut "Toggle between editor and sidebar" should exist.

documentation
It should be mentioned in the documentation, for example on https://github.com/xiota/geany-preview/blob/main/docs/CQA.md, that in case the shortcut "Toggle between editor and sidebar" was set, but neither for "Toggle editor" nor for "Toggle sidebar" a shortcut was set, the ways how to leave the only-view is, a) by restarting Geany, or b) that this need to be done first: set a shortcut either for "Toggle sidebar" or for "Toggle editor", and then press 1x or 2x the corresponding shortcut.

overview
This would be the possible list of the shortcuts for the navigation between editor and sidebar inside the plugin:
Toggle focus between editor and sidebar (the shortcut already exist in the plugin) xiota/geany-tab-style#5 #34 (comment)
Toggle sidebar #37
Toggle editor #38
Toggle between editor and sidebar (this issue)

development
First #37 and #38 need to be solved, then the solutions need to be checked for some weeks, before to start to solve this issue, because it could be that new problems will appear.

@xiota
Copy link
Owner

xiota commented Aug 8, 2022

Is this to show hide the editor or sidebar, so that only one is visible, similar to the lua script that hides the editor?

@ralf3u
Copy link
Author

ralf3u commented Aug 8, 2022

Is this to show hide the editor or sidebar, so that only one is visible, ...

Yes, that's correct. By pressing the shortcut the view changes to a view, where only one is visible. If the shortcut is pressed again, there will be still only one visible.

@xiota
Copy link
Owner

xiota commented Aug 8, 2022

I would rather do this as a lua script. There would be several scripts, corresponding with the multiple issues that you opened, that interact with each other.

@ralf3u
Copy link
Author

ralf3u commented Aug 8, 2022

I would rather do this as a lua script. There would be several scripts, corresponding with the multiple issues that you opened, that interact with each other.

OK, but what are the reasons in short not to integrate it in Geany Preview?

@ralf3u
Copy link
Author

ralf3u commented Aug 8, 2022

I would rather do this as a lua script.

In the last lua-script (xiota/geanylua-scripts#4) the focus feature was not solved. In #37 I mentioned this:

Maybe the focus feature could be solved with copy & paste of a part of the code of the shortcut "Toggle focus between the editor and preview", because they have both exactly the same focus feature.

And that was also a reason for me why to integrate the shortcut in Geany Preview, so not as lua-script, because the focus feature is already solved in the shortcut "Toggle focus between the editor and preview".

@xiota
Copy link
Owner

xiota commented Aug 8, 2022

Focus is problematic. Something in the preview tab ends up in focus, but whether it's exactly what you want is hit and miss. I think you mentioned that elsewhere when you tried to do keyboard navigation.

@ralf3u
Copy link
Author

ralf3u commented Aug 8, 2022

Focus is problematic.

Till now focus is only problematic when the mouse comes into action (see xiota/geany-tab-style#6 and #15).
So for shortcuts, focus is not problematic. That is the reason why the shortcut "Toggle focus between editor and preview" works perfect. So, focus should be no problem for #37, #38 and this issue, because it is all about shortcuts.

@ralf3u
Copy link
Author

ralf3u commented Sep 21, 2022

I would rather do this as a lua script. There would be several scripts, corresponding with the multiple issues that you opened, that interact with each other.

Unfortunately at the moment it seems to be that the focus feature can't be solved (xiota/geany-tab-style#6), so now there's only the crisscross feature left that could be realized. Would it be possible to create lua-scripts for #37, #38 and #40?

@ralf3u
Copy link
Author

ralf3u commented Oct 9, 2022

Today I prefer this name as shortcut because it is more clear about what it is:
Toggle only editor/only sidebar
An alternative would be:
Toggle between only editor and only sidebar
Maybe the last one is better.

@ralf3u
Copy link
Author

ralf3u commented Oct 11, 2022

focus-feature
For reasons of documentation, I would like to mention that, according to xiota/geany-tab-style#6, the focus-feature could be realized in this issue by a kind of copy/paste of the focus-feature of the shortcut "Toggle focus between editor and sidebar":

Not exactly copy/paste, but they're doable.

@ralf3u
Copy link
Author

ralf3u commented Oct 19, 2022

Clear separation
Since end of last week I think that it would be better to have a clear separation between #37 & #38, and this issue, else it creates confusion. That means that an additional shortcut for leaving is necessary.

Additional shortcut
An additional shortcut next to the shortcut Toggle between only editor and only sidebar would be good with this kind of text:
Exit "Toggle between only editor and only sidebar"

No crisscross feature any more
a
If #37 or #38 is active, then by pressing the shortcut Toggle between only editor and only sidebar, nothing should happen.
b
If Toggle between only editor and only sidebar is active, and then by pressing the shortcut #37 or #38, nothing should happen.

Conclusion
Three state file are still needed.

Entering
When the shortcut Toggle between only editor and only sidebar is pressed, then the content-area of the corresponding tab should still stay in focus.

Exit
When the shortcut Exit "Toggle between only editor and only sidebar" is pressed, then the content-area of the corresponding tab should still stay in focus.

@ralf3u
Copy link
Author

ralf3u commented Oct 19, 2022

The advantage of the shortcut Exit "Toggle between only editor and only sidebar" is that by pressing it, it leaves right away the mode Toggle between only editor and only sidebar.

@ralf3u
Copy link
Author

ralf3u commented Oct 19, 2022

When the shortcut is active (specially in the only-editor-mode):
It would be good if tab-browsing in the editor works correct with auto-sidebar.

@ralf3u
Copy link
Author

ralf3u commented Oct 20, 2022

Would it be possible to program the four shortcuts down below (with the focus feature #40 (comment)) till the end of 2022?

Toggle between only editor and editor/sidebar
Toggle between only sidebar and editor/sidebar
Toggle between only editor and only sidebar
Exit "Toggle between only editor and only sidebar"

@xiota xiota added enhancement New feature or request wontfix This will not be worked on labels Feb 25, 2023
@xiota
Copy link
Owner

xiota commented Feb 25, 2023

This can probably be done with the lua scripts.

@xiota xiota closed this as completed Feb 25, 2023
@xiota xiota closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2023
@ralf3u
Copy link
Author

ralf3u commented Feb 25, 2023

I have also to rethink about this shortcut.

@ralf3u
Copy link
Author

ralf3u commented Feb 25, 2023

Would it be possible to program the four shortcuts down below (with the focus feature #40 (comment)) till the end of 2022?
Toggle between only editor and editor/sidebar
Toggle between only sidebar and editor/sidebar
Toggle between only editor and only sidebar
Exit "Toggle between only editor and only sidebar"

I recognize now that I don't need those shortcuts any more (the current shortcut "Toggle editor" is enough for me). Nevertheless I will open new issues for the shortcuts mentioned above on geanylua-scripts during the next days.

@xiota
Copy link
Owner

xiota commented Feb 25, 2023

Please open only one issue for all four (or however many you decide you'd like) on the lua scripts github. Please keep the description brief. You can also link back to the issues here. Thank you.

BTW: PPA has been updated with a new version. You can read the commit log for a brief description of the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants