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

[switch-views:] Editor is not in focus neither with the shortcut "Toggle sidebar 1" nor with the shortcut "Toggle sidebar 2" #15

Open
ralf3u opened this issue Jan 22, 2025 · 4 comments

Comments

@ralf3u
Copy link

ralf3u commented Jan 22, 2025

Steps to reproduce

  1. only editor is visible
  2. press shortcut "Toggle sidebar 1" nor "Toggle sidebar 2" of switch-views to see editor&sidebar
  3. press shortcut "Toggle editor 1" to see only the sidebar
  4. click inside the content-area of the preview-tab to put there the focus
  5. press shortcut "Toggle sidebar 1" or "Toggle sidebar 2" of switch-views to see only the editor

Result
The editor is not in focus.

Expectation
The editor should be in focus.

@xiota
Copy link
Owner

xiota commented Jan 22, 2025

I think this is probably related to geany-plugins PR 1234, which fixes a bug in geanylua in the activate function. May (or may not) be helpful to leave a short comment there saying that you're affected by the bug.

@ralf3u
Copy link
Author

ralf3u commented Jan 22, 2025

I think this is probably related to geany-plugins PR 1234, [...]

I don't think so, because with the shortcut switch-views-(editor-↔-sidebar).lua the editor is in focus how it should be. I think that geany-plugins PR 1234 is among others about the focus issue of the content-area of the prebiew-tab.

Just compare the following example with the report of this issue:

Steps to reproduce

  1. only editor is visible
  2. press shortcut switch-views-(editor-↔-sidebar).lua of switch-views to see only the sidebar
  3. do nothing (it is just to have the same numbers like in the report)
  4. click inside the content-area of the preview-tab to put there the focus
  5. press again the shortcut switch-views-(editor-↔-sidebar).lua of switch-views to see only the editor

Result
The editor is in focus.

So, if "set focus back to the editor" works in the shortcut switch-views-(editor-↔-sidebar).lua, it should also work for the shortcut Toggle sidebar 1 .

The same applies for #14.

@ralf3u
Copy link
Author

ralf3u commented Jan 22, 2025

I found the mistake. In the document toggle-sidebar-1.lua I added at the end:


editor_focus()

I saved the document, and then I restarted Geany. Now this issue is fixed.

Could you please correct switch-views?

Please leave me a message when switch-views is corrected, so I will close this issue.

@ralf3u
Copy link
Author

ralf3u commented Jan 22, 2025

Before to change switch-views, could you please check if my solution of my last comment is correct?

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

2 participants