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 when toggling with "toggle-editor-1.lua" or "toggle-editor-2.lua" #14

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

Comments

@ralf3u
Copy link

ralf3u commented Jan 21, 2025

Current situation
Neither toggle-editor-1.lua nor toggle-editor-2.lua have focus on the editor when switching back from only sidebar to editor&sidebar.

Expectation
One of both shortcuts should put editor in focus when switching back from only sidebar to editor&sidebar.

@ralf3u ralf3u changed the title [switch-views:] Editor is not in focus as it should be when toggling [switch-views:] Editor is not in focus when toggling with "toggle-editor-1.lua" or "toggle-editor-2.lua" Jan 21, 2025
@ralf3u
Copy link
Author

ralf3u commented Jan 22, 2025

One of both shortcuts should put editor in focus when switching back from only sidebar to editor&sidebar.

I would prefer when the shortcut toggle-editor-1.lua has focus on the editor (so, not the shortcut toggle-editor-2.lua).

@ralf3u
Copy link
Author

ralf3u commented Jan 22, 2025

I found the mistake. In the document toggle-editor-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 the solution in my last comment is correct?

@xiota
Copy link
Owner

xiota commented Jan 23, 2025

This is the function in question:

function sidebar_focus()
  if sidebar_is_visible() then
    geany.keycmd("FOCUS_SIDEBAR")
  end
end

The problem could be that it focuses the sidebar, but maybe not the part of the sidebar you want to be in focus?

Another potential issue is if you are using Wayland. I've read Wayland handles input differently from X11.

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