Skip to content

Offer "toggle-views" with only three shortcuts with conditions & new names #16

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

Open
ralf3u opened this issue Jan 25, 2025 · 0 comments
Open

Comments

@ralf3u
Copy link

ralf3u commented Jan 25, 2025

I think it would be good to offer users next to switch-views also toggle-views. The switch-views are more a kind of playground for developers while toggle-views would be for normal users.

Programming of toggle-views
The switch-views can be used as base. Then reduce switch-views to those three shortcuts:

  • toggle-editor-1.lua
  • toggle-sidebar-1.lua
  • switch-views-(editor-↔-sidebar).lua

Then change the name of the shortcuts (see down below in Name of the shortcuts) and add three conditions (see down below in Condition of the shortcuts).

Name of the shortcuts
Toggle between only editor and editor&sidebar
Toggle between editor&sidebar and only sidebar
Toggle between only editor and only sidebar

Condition of the shortcuts

  1. Toggle between only editor and editor&sidebar
    If only sidebar is visible do nothing.
    In other words: If only editor or editor&sidebar are shown, then do ...
  2. Toggle between editor&sidebar and only sidebar
    If only editor is visible do nothing.
    In other words: If editor&sidebar or only sidebar are shown, then do ...
  3. Toggle between only editor and only sidebar
    If editor&sidebar is visible do nothing.
    In other words: If only editor or only sidebar are shown, then do ...

Content of the document hotkeys.cfg

Toggle-between-only-editor-and-editor&sidebar.lua
Toggle-between-editor&sidebar-and-only-sidebar.lua
Toggle-between-only-editor-and-only-sidebar.lua

Document init.lua
Instead of sidebar_start = "show": sidebar_start = "hide".
Reasons:
The most people use Geany also for other formats, like TXT-documents. I made the experience that auto-sidebar is not good for me when using the shortcuts of switch-views.

History
This issue is based on the knowledge of xiota/geany-tab-style#2 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant