-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
sticky TabMovesFocus config #9705
Comments
Yeah today I was in a state in which Tab was moving focus instead of indenting. I couldn't reproduce though. I know I didn't have tabs enabled, too. |
@alexandrudima I have pushed da56a2c to 'fix' this cos I could see this event wasn't fired after the |
@joaomoreno Can you check with my steps from above without tabs? Also can you check that my change fixes this? |
Yup! I can repro before your change but not anymore after it. 👍 |
When the Cmd+, command happens a third editor is created and leaked. That editor is readonly and somehow interferes with another editor... |
@bpasero Please check the changes in 3f446e4. The issue is like this:
My main question is why we have more than (max) three code editor widgets? |
I hit another problem which led me to realise that all editor settings are affected. I've updated the initial comment with more generalised repro steps. |
bummer - that's likely due to the change @aeschli and I made. Invisible editors don't listen to config changes anymore tho probably should update when becoming visible... |
We must do something about this... |
@joaomoreno I have moved the issue you described in #9892 cos it's a regression from not listening to config change event anymore |
Got it, thought it to be exactly the same. Sorry about that. |
@jrieken we can have more than 3 code editor widgets easily once we show the diff editor. So typically you can have 6 editors lying around (3 code editors and 3 diff editors). There is no specific reason why a second code editor instance is being created for some inputs (readonly) and the one we have for files not being reused. This could probably be changed, but given the diff editor challenge, we might need a better solution to handle that case as well. |
How about disposing? |
@jrieken yes I can do that. @alexandrudima objections? The consequence is that an editor gets disposed as soon as either another editor or non-editor opens in a slot (this includes binary files, HTML previews, extension editors). |
Not optimal, but disposing editors should be fine: there is some start-up time (in the range of a few millis) that is spent mostly instantiating contributions, but it might be non-noticeable. |
@jrieken @alexandrudima I am also fine to have API to call to indicate to the editor that it is hidden, in fact I am already calling |
I'm sorry I don't have the time to go through all editor contributions and adopt in each and every one of them that they don't touch context keys unless the editor is visible. It is also a solution that does not guarantee bug-free new contributions. (It is possible that people update those context keys from external sources in various event listeners) Moreover, a pointer to the keybinding service can be grabbed by any editor client and a context key can be set outside editor contributions. |
Ok I think I need more background on the issue, since I am not on the same page since I was on vacation. Somehow I thought this issue was coming from our use of keybinding service but I probably got that wrong. Note that we have hidden editors since the beginning so I am not sure what recent change causes the editor config to get wrong. |
Well, an example always helps. Consider the context key The
Now consider two editors that each have their own Most times, the first one maybe has sufficient time to stop itself (via Now, if the timing is not spotless or if there are other conditions, the "hidden" find controller might interfere with the "visible" find controller and set the |
@alexandrudima yeah I see the issue but is that not #10122 ? I am asking because this issue is about |
They might all have the same root cause. Context keys might end up with incorrect values when multiple editor instances try to drive them. |
Joh explained to me, I got it now. All related. We decided to start to dispose() hidden editors. @alexandrudima is there a difference between dispose() and destroy() in your world? |
I left |
Merging into #10358 |
Steps to Reproduce (1/2)
showTabs
)Keyboard Shortcuts
config actionCmd+1
to focus column Open Source VS Code #1Steps to Reproduce (2/2)
Tab will now focus away from the editor instead of inserting a
TAB
.The text was updated successfully, but these errors were encountered: