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 editor" to the plugin #38

Closed
ralf3u opened this issue Jun 16, 2022 · 12 comments
Closed

add the shortcut "Toggle editor" to the plugin #38

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

Comments

@ralf3u
Copy link

ralf3u commented Jun 16, 2022

condition
before to start to solve this issue, the shortcut name "Toggle between the editor and preview" should be changed to "Toggle between editor and preview" #34 (comment)

behavior
when pressing 1x the shortcut "Toggle editor", only the editor should appear; the highlighted line should be there
when pressing it again, the only-editor-view should not be there any more; the highlighted line should be there

reasons for adding the shortcut to the plugin
because the shortcut "Toggle Sidebar" of Geany does not have a state file, it is necessary to add the shortcut "Toggle editor" to the plugin (the shortcut "Toggle Sidebar" would correspond from the handling to the shortcut "Toggle editor" of Geany Preview), in order to add a state file, so that xiota/geanylua-scripts#3 and the crisscross feature down below can be solved

focus feature
always after pressing the shortcut: the content of the editor should be in focus, so the highlighted line should be there;
this feature is not necessary to program, because it works perfect at the moment with the shortcut "Toggle Sidebar", that would correspond to the shortcut "Toggle editor" in Geany Preview

crisscross feature
when pressing "Toggle sidebar", first the state file of the "Toggle sidebar" need to be checked;
so, if only-sidebar-view is active, then first de-activate only-sidebar-view

name of the shortcut
see explication in "name of the shortcut" in #37 (comment)

autoside-bar
this issue should also keep an eye on this issue xiota/geanylua-scripts#3;

  • if only-editor-view is active, then deactivate auto-sidebar
  • if only-editor-view is going from active to de-active, then activate auto-sidebar

when closing Geany
if only-editor-view is active:

  • then deactivate only-editor-view, so that after a restart of Geany, editor and preview are side-by-side
  • activate auto-sidebar, so that after a restart of Geany, auto-sidebar is active
@xiota
Copy link
Owner

xiota commented Aug 8, 2022

Is this to hide the editor and show only the sidebar? Don't you already have this feature with a lua script?

@ralf3u
Copy link
Author

ralf3u commented Aug 8, 2022

Is this to hide the editor and show only the sidebar?

No, it is to show only the editor, so to hide the sidebar.

Don't you already have this feature with a lua script?

The lua-script is the alternative to #37.

@xiota
Copy link
Owner

xiota commented Aug 8, 2022

No, it is to show only the editor, so to hide the sidebar.

The lua-script is the alternative to #37.

So a similar lua script could resolve this too?

@ralf3u
Copy link
Author

ralf3u commented Aug 8, 2022

So a similar lua script could resolve this too?

No, this is not necessary because in Geany there is already the shortcut "Toggle Sidebar". When I press that shortcut, then I can see only the editor. But the two disadvantages are:
1: it does not offer focus feature (see description above)
2: it does not offer crisscross feature (see description above)

@ralf3u
Copy link
Author

ralf3u commented Aug 8, 2022

So a similar lua script could resolve this too?

If both disadvantages from my last comment could be solved, then why not.

@xiota
Copy link
Owner

xiota commented Aug 8, 2022

Trying to get focus to work has been frustrating. I'd rather not mess with it.

Does "crisscross feature" mean that the different toggles are aware of each other? I think that can be managed in the scripts. It makes them a bit more complicated, but still easier to write lua script than to change C code.

@ralf3u
Copy link
Author

ralf3u commented Oct 11, 2022

focus-feature
For reasons of documentation, I would like to mention that, according to #5 (comment), 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

Today I have a better shortcut name than Toggle editor:
Toggle between only editor and editor/sidebar

@ralf3u
Copy link
Author

ralf3u commented Oct 19, 2022

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

@ralf3u
Copy link
Author

ralf3u commented Oct 20, 2022

Today I think it is better not to offer the crisscross-feature to the shortcut, because the shortcut Toggle between only editor and only sidebar offers the crisscross-feature. I recognized today that this would mean less confusion.

So, if the shortcut is active (only editor is visible) and if the shortcut #37 is pressed, then nothing should happen.

@ralf3u
Copy link
Author

ralf3u commented Feb 14, 2023

Just for information:
Also for a better performance of this fictional shortcut Toggle between only editor and editor/sidebar, I just opened at Geany a new issue with the number 3399 with the title "Highlighted line is not in the visible area when toggling sidebar 2x".

@xiota xiota added enhancement New feature or request wontfix This will not be worked on labels Feb 25, 2023
@xiota xiota closed this as completed Feb 25, 2023
@ralf3u
Copy link
Author

ralf3u commented Feb 25, 2023

It was good that this issue was not fixed, because I just recognized that the Lua Script (https://github.com/xiota/geanylua-scripts/tree/main/toggle-editor) works perfect for me, because I changed the last days the way to code. The focus stays always in the editor while toggling, and that's good.

Two things that can be taken from this issue:
1
changing the current name from Toggle editor to Toggle between only editor and editor/sidebar would be good (even if it is a little bit long), because it describes better what happens while toggling
2
I think an additional Lua Script would be good, where also at the same time the focus would toggle.
The shortcut name could be something like Toggle between only editor and editor/sidebar, + focus.
Personally I would use that shortcut not so much like the current shortcut.
I will open tomorrow a new issue for this shortcut on the geanylua-scripts-webpage.

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