-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Unable to next/previous via keybindings when diff editor is not focused #14124
Comments
Yeah, it works without the 'when', so maybe |
@roblourens that's right, it can certainly work as a global shortcut without the For example, there's already another useful mapping for |
@rob3c does it reproduce if you assign other keys (F10, F11)? |
@bpasero Unfortunately, no. Even using keys that don't already have other keybindings like F6 and F10 (F11 is bound to It seems to be a change in the UPDATE: oops, you were asking if the bug is reproduced with other keys...YES! (answered too quickly) |
@rob3c it does not reproduce for me on Windows so I am clueless. If someone wants to step in a provide a PR, feel free. |
I'm reproing it on OSX. I can try to debug if you have some pointers. |
No, that looks exactly like what I'm doing. |
@bpasero Yes, you're setting global handlers without the
|
Oh, good catch |
I can reproduce but I have no clue why it fails. @alexandrudima @jrieken when My gut feeling is that this was caused by introducing a scoped keybinding service per editor, though I thought we took this out again. |
I have reverted my changes a long time ago. My guess is that this happened during the editor action refactoring |
@jrieken IMHO this is caused by the introduction of a context per editor slot. keyboard shortcuts:
To re-state what the OP is saying: In the past
Today
I have added a console.log to check what context service we get in the ctor at https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/browser/parts/editor/textDiffEditor.ts#L69 and it is not the global context key service. Before the refactoring, there was only the global context key service and one for each editor instance. Now we have the extra 3 for the 3 slots and the diff editor is getting one of the children context key services. Therefore, when the focus is not in the diff editor, the context key is not found (in the global context). |
I suggest as a fix to somehow get ahold of the global context key service but even in that case it seems to be the code was buggy before, as in case you had two diffs opened, the key would be set to true twice, then when closing the first diff (meanwhile the other one is still open), the key would be set to false. @bpasero |
Thanks, everyone, for looking into fixing this! I'm wondering if maybe this issue is also affecting some other keyboard shortcuts more generally? For example, I've notice that |
This is a problem with the DiffNavigation actions because they are local to one diff editor and therefore not actionable globally. The same is true for things like 'Find References'. As it was already mentioned, either there is only one occurrence of the |
The command was actually always fit to be handled from the global context. Pushed a fix to not set the context per editor but globally. |
Steps to Reproduce:
ctrl+down
andctrl+up
toworkbench.action.compareEditor.nextChange
andworkbench.action.compareEditor.previousChange
withwhen
set totextCompareEditorVisible
.CHANGES
list to select it and show its diff on the right.ctrl+down
and/orctrl+up
to navigate the changes while the git panel still has focus.Navigating the file diff with
ctrl+down/up
used to work when single-clicking a file in theCHANGES
list when this feature was first released. This broken sometime within the past several versions (I should've reported the regression sooner), and now you have to actually focus a file by double-clicking aCHANGES
entry or manually clicking in one of the two displayed files on the right. This has become increasingly annoying enough that I finally remembered to make an issue about it :-)Anyway, please restore the previous behavior when you have a chance, as the
when
context name suggests it should merely bevisible
rather thanfocused
! The feature was really nice and streamlined before, but has become a bottleneck now for us keyboard navigators. With theCHANGES
list in continual focus, it was really nice to be able toup/down
in the list to select files, and thenctrl+up/down
to scan through their changes.Thanks in advance!
The text was updated successfully, but these errors were encountered: